/* ============================================================
   Cecilia's Programme — dark theme
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:          #011829;   /* darker than brand dark, for depth */
  --bg-card:     #012030;   /* brand dark */
  --bg-elevated: #01293f;   /* lighter surface for dialogs etc. */
  --border:      rgba(0, 227, 174, 0.1);

  --text:        #faf6e9;   /* brand cream */
  --text-muted:  rgba(250, 246, 233, 0.55);
  --text-dim:    rgba(250, 246, 233, 0.28);

  --accent:      #00e3ae;   /* brand accent */
  --accent-dim:  rgba(0, 227, 174, 0.12);
  --accent-glow: rgba(0, 227, 174, 0.22);

  --green:       #00e3ae;
  --green-dim:   rgba(0, 227, 174, 0.1);
  --blue:        #38bdf8;
  --blue-dim:    rgba(56, 189, 248, 0.1);
  --slate-dim:   rgba(250, 246, 233, 0.06);
  --slate:       rgba(250, 246, 233, 0.38);

  --radius:    16px;
  --radius-sm: 10px;
}

/* ── Base ───────────────────────────────────────────────────── */

html { color-scheme: dark; }

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Nav ────────────────────────────────────────────────────── */

.nav {
  background: rgba(1, 24, 41, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s;
}

.nav-link:hover { color: var(--text); }

.nav-form { display: inline; }

.nav-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  transition: color 0.15s;
}

.nav-logout:hover { color: var(--text); }

/* ── Layout ─────────────────────────────────────────────────── */

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1rem 5rem;
}

/* ── Buttons ────────────────────────────────────────────────── */

.btn {
  display: block;
  width: 100%;
  padding: 0.95rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  line-height: 1.25;
  font-family: inherit;
  transition: all 0.15s;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--accent);
  color: #011829;  /* dark text — better contrast on bright teal */
  box-shadow: 0 0 20px var(--accent-glow), 0 2px 8px rgba(0,0,0,0.4);
}

.btn-primary:hover {
  background: #00f0ba;
  box-shadow: 0 0 30px var(--accent-glow), 0 4px 12px rgba(0,0,0,0.5);
}

.btn-primary:active { transform: scale(0.98); }

.btn-advance {
  background: linear-gradient(135deg, #00e3ae 0%, #00c4a0 100%);
  color: #011829;
  box-shadow: 0 0 24px var(--accent-glow), 0 4px 16px rgba(0,0,0,0.4);
}

.btn-advance:hover {
  box-shadow: 0 0 36px var(--accent-glow), 0 6px 20px rgba(0,0,0,0.5);
  transform: translateY(-1px);
}

.btn-advance:active { transform: scale(0.98); }

.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

/* ── Cards ──────────────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  position: relative;
  overflow: hidden;
}

/* Subtle shimmer line across the top of each card */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 227, 174, 0.3) 40%,
    rgba(0, 200, 160, 0.2) 60%,
    transparent 100%);
}

/* ── Badges ─────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.badge-done {
  background: var(--green-dim);
  color: var(--green);
  box-shadow: 0 0 10px rgba(74,222,128,0.15);
}

.badge-active {
  background: var(--blue-dim);
  color: var(--blue);
}

.badge-pending {
  background: var(--slate-dim);
  color: var(--slate);
}

/* ── Forms ──────────────────────────────────────────────────── */

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  -webkit-appearance: none;
}

input::placeholder { color: var(--text-dim); }

input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(129, 140, 248, 0.05);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 0.375rem;
}

.field { margin-bottom: 1rem; }

/* ── Login ──────────────────────────────────────────────────── */

.login-wrap {
  max-width: 380px;
  margin: 4rem auto 0;
}

.login-title {
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.375rem;
  background: linear-gradient(135deg, var(--text) 40%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-sub {
  color: var(--text-muted);
  font-size: 0.925rem;
  margin-bottom: 2rem;
}

.login-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.error {
  color: #f87171;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  padding: 0.625rem 0.875rem;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius-sm);
}

/* ── Session hero ───────────────────────────────────────────── */

/* Breaks out of .container padding to go full-width */
.session-hero {
  margin: -1.5rem -1rem 1.5rem;
  padding: 2rem 1.25rem 1.75rem;
  background: linear-gradient(160deg, #01293f 0%, #011829 80%);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

/* Decorative radial glow in top-right corner */
.session-hero::after {
  content: '';
  position: absolute;
  top: -80px;
  right: -60px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(0, 227, 174, 0.1) 0%, transparent 65%);
  pointer-events: none;
}

.unit-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.4rem;
  position: relative;
  z-index: 1;
}

.session-title {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  margin-bottom: 1.1rem;
  color: var(--text);
  position: relative;
  z-index: 1;
}

.session-progress {
  display: flex;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

/* ── Advance block ──────────────────────────────────────────── */

.advance-wrap {
  background: linear-gradient(135deg,
    rgba(0, 227, 174, 0.07),
    rgba(0, 200, 160, 0.05));
  border: 1px solid rgba(0, 227, 174, 0.2);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.advance-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.875rem;
}

/* ── Programme info panel ───────────────────────────────────── */

.info-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.info-summary {
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.15s;
}

.info-summary:hover { color: var(--text); }
.info-summary::-webkit-details-marker { display: none; }
.info-summary::after { content: '↓'; font-size: 0.75rem; }
details[open] .info-summary::after { content: '↑'; }

.info-body {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* ── Exercise cards ─────────────────────────────────────────── */

.exercise-name {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.exercise-meta {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.625rem;
}

.exercise-goal {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.notes-details { margin-bottom: 0.875rem; }

.notes-summary {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.notes-summary:hover { opacity: 1; }
.notes-summary::-webkit-details-marker { display: none; }

.exercise-notes {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: 0.5rem;
  padding-left: 0.75rem;
  border-left: 2px solid rgba(0, 227, 174, 0.25);
}

.achieved-field { margin-top: 0.875rem; }

.set-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.5rem;
}

.set-row:last-child { margin-bottom: 0; }

.set-num {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  flex-shrink: 0;
}

.goal-sets {
  margin-bottom: 0.625rem;
}

.goal-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 0.375rem;
}

.goal-set-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.goal-value {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.save-wrap { margin-top: 0.5rem; }

/* ── Advance confirmation dialog ────────────────────────────── */

dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  background: var(--bg-elevated);
  max-width: 360px;
  width: calc(100% - 2rem);
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.dialog-inner { padding: 1.5rem; }

.dialog-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.625rem;
}

.dialog-body {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

/* ── Instructions ───────────────────────────────────────────── */

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  position: relative;
  overflow: hidden;
}

.info-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 227, 174, 0.3) 40%,
    rgba(0, 200, 160, 0.2) 60%,
    transparent 100%);
}

.info-card-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.info-card-body {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.info-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.info-link:hover {
  text-decoration: underline;
}

/* ── History ────────────────────────────────────────────────── */

.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.history-unit {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.875rem;
  overflow: hidden;
}

.history-unit-header {
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.history-unit-title {
  font-weight: 700;
  font-size: 1rem;
}

.history-session {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.history-session:last-child { border-bottom: none; }

.history-session-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
}

.history-table th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0 0.5rem 0.5rem 0;
}

.history-table td {
  padding: 0.4rem 0.5rem 0.4rem 0;
  vertical-align: top;
  border-top: 1px solid var(--border);
  line-height: 1.4;
  color: var(--text-muted);
}

.history-table td:first-child { color: var(--text); }

.history-table tr:first-child td { border-top: none; }

.empty {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}
