/* ═══════════════════════════════════════════════════════
   THE SOMA CODE METHOD — Design System v2
   Sora · Unified
   Light Auric Portal · Bright Login
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&display=swap');

/* ─── FONT ROLE — one font, all weights ──────────────── */
:root {
  --font-body:   'Sora', sans-serif;
  --font-accent: 'Sora', sans-serif;
  --font-script: 'Sora', sans-serif;
}

/* ─── RESET ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── HEADINGS — weight-based hierarchy only ─────────── */
h1, h2, h3 {
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
a { text-decoration: none; }

/* ═══════════════════════════════════════════════════════
   THEME A — LOGIN (Bright Luminous Glass)
   ═══════════════════════════════════════════════════════ */
.login-page {
  --bg:           #faf8f4;
  --bg-2:         #f4f0e8;
  --bg-3:         #ede8f0;
  --glass-bg:     rgba(255,255,255,0.62);
  --glass-bg-h:   rgba(255,255,255,0.82);
  --glass-border: rgba(255,255,255,0.90);
  --glass-border-h: rgba(255,255,255,1);
  --glass-blur:   44px;

  /* Auric palette */
  --col-gold:     #b8864a;
  --col-gold-dim: rgba(184,134,74,0.5);
  --col-violet:   #7b5ea7;
  --col-ice:      #4a7fa5;
  --col-rose:     #b86080;

  --text-1:       #1a2540;
  --text-2:       rgba(26,37,64,0.58);
  --text-3:       rgba(26,37,64,0.36);

  background: var(--bg);
  color: var(--text-1);
}

/* ═══════════════════════════════════════════════════════
   THEME B — PORTAL (Light Auric)
   ═══════════════════════════════════════════════════════ */
.portal-page {
  --bg:           #f6f3ee;
  --bg-2:         #eeeae2;
  --bg-3:         #e8e3d9;
  --glass-bg:     rgba(255,255,255,0.72);
  --glass-bg-h:   rgba(255,255,255,0.88);
  --glass-border: rgba(0,0,0,0.06);
  --glass-border-h: rgba(0,0,0,0.12);
  --glass-blur:   20px;

  /* Auric palette */
  --col-gold:     #b8864a;
  --col-gold-dim: rgba(184,134,74,0.5);
  --col-violet:   #7b5ea7;
  --col-ice:      #4a7fa5;
  --col-rose:     #a05878;
  --col-mint:     #4a8870;

  --text-1:       #1a2540;
  --text-2:       rgba(26,37,64,0.6);
  --text-3:       rgba(26,37,64,0.35);

  /* Orb colors */
  --orb-1: rgba(201,165,94,0.18);
  --orb-2: rgba(123,94,167,0.14);
  --orb-3: rgba(201,130,100,0.12);
  --orb-4: rgba(74,127,165,0.1);

  background: var(--bg);
  color: var(--text-1);
}

/* ─── SHARED TOKENS ─────────────────────────────────── */
:root {
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 40px;
  --radius-pill: 999px;

  --shadow-sm:    0 2px 12px rgba(0,0,0,0.08);
  --shadow-md:    0 6px 28px rgba(0,0,0,0.13);
  --shadow-lg:    0 16px 56px rgba(0,0,0,0.18);
  --shadow-dark:  0 24px 80px rgba(0,0,0,0.55);
  --shadow-glass-dark: 0 8px 40px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.08);
  --shadow-glass-light: 0 4px 24px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.9);

  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
  --transition-fast: 0.16s ease;
  --transition-slow: 0.5s cubic-bezier(0.4,0,0.2,1);
}

/* ═══════════════════════════════════════════════════════
   LOGIN PAGE BACKGROUND — Bright Luminous Glass
   ═══════════════════════════════════════════════════════ */

/* Bright base — warm white with a faint gradient shift */
.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(145deg,
    #ffffff     0%,
    #faf7f1    35%,
    #f5f1f8    65%,
    #f0f5fa   100%);
  overflow: hidden;
}

/* ─── Floating luminous orbs ─── */
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  animation: orb-float var(--dur, 22s) ease-in-out infinite alternate;
  pointer-events: none;
}

.login-orb-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(201,165,94,0.30) 0%, transparent 70%);
  top: -20%; left: -12%;
  --dur: 22s;
}
.login-orb-2 {
  width: 580px; height: 580px;
  background: radial-gradient(circle, rgba(123,94,167,0.22) 0%, transparent 70%);
  bottom: -15%; right: -8%;
  --dur: 28s;
  animation-direction: alternate-reverse;
}
.login-orb-3 {
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(184,96,128,0.18) 0%, transparent 70%);
  top: 25%; right: 5%;
  --dur: 20s;
}
.login-orb-4 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(74,127,165,0.16) 0%, transparent 70%);
  bottom: 15%; left: 8%;
  --dur: 26s;
  animation-direction: alternate-reverse;
}

/* Soft inner luminance overlay — makes it feel lit from within */
.login-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%,
    rgba(255,255,255,0.70) 0%,
    transparent 60%);
  pointer-events: none;
}

/* Floating light particles */
.login-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  animation: particle-rise linear infinite;
}

@keyframes particle-rise {
  0%   { transform: translateY(0) scale(1);    opacity: 0; }
  12%  { opacity: 0.55; }
  88%  { opacity: 0.2; }
  100% { transform: translateY(-100vh) scale(0.3); opacity: 0; }
}

/* Deprecated dark elements — hidden */
.login-stars { display: none; }
.login-grid  { display: none; }

/* ─── Card shimmer & glow ─── */
@keyframes card-shimmer {
  0%   { left: -150%; }
  100% { left: 150%; }
}

@keyframes card-glow-pulse {
  0%, 100% {
    box-shadow:
      0 8px 48px rgba(0,0,0,0.09),
      0 2px 8px rgba(0,0,0,0.04),
      inset 0 1px 0 rgba(255,255,255,1),
      inset 0 -1px 0 rgba(255,255,255,0.5);
  }
  50% {
    box-shadow:
      0 12px 60px rgba(184,134,74,0.14),
      0 2px 8px rgba(0,0,0,0.04),
      inset 0 1px 0 rgba(255,255,255,1),
      inset 0 -1px 0 rgba(255,255,255,0.5);
  }
}

/* ═══════════════════════════════════════════════════════
   PORTAL BACKGROUND (Light Auric)
   ═══════════════════════════════════════════════════════ */
.portal-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(145deg, #f8f5ef 0%, #f0ece2 40%, #ede8f5 100%);
  overflow: hidden;
  pointer-events: none;
}

.portal-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.portal-orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(201,165,94,0.25), transparent 70%);
  top: -15%; left: -10%;
  animation: orb-float 22s ease-in-out infinite alternate;
}

.portal-orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(123,94,167,0.18), transparent 70%);
  bottom: -10%; right: -5%;
  animation: orb-float 28s ease-in-out infinite alternate-reverse;
}

.portal-orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(201,130,100,0.15), transparent 70%);
  top: 40%; left: 55%;
  animation: orb-float 18s ease-in-out infinite alternate;
}

.portal-orb-4 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(74,127,165,0.13), transparent 70%);
  top: 65%; left: 15%;
  animation: orb-float 24s ease-in-out infinite alternate-reverse;
}

@keyframes orb-float {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(30px, -25px) scale(1.06); }
  66%  { transform: translate(-15px, 30px) scale(0.96); }
  100% { transform: translate(20px, 15px) scale(1.04); }
}

/* ═══════════════════════════════════════════════════════
   GLASS COMPONENTS
   ═══════════════════════════════════════════════════════ */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.glass:hover {
  border-color: var(--glass-border-h);
  background: var(--glass-bg-h);
}

/* Portal card shadow differs from login */
.portal-page .glass {
  box-shadow: var(--shadow-glass-light);
}
.login-page .glass {
  box-shadow: var(--shadow-glass-dark);
}

/* ═══════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════ */
h1 { font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; }
h3 { font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 600; line-height: 1.35; }

.eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.login-page .eyebrow { color: var(--col-gold-dim); }
.portal-page .eyebrow { color: var(--col-gold); }

.gradient-text-dark {
  background: linear-gradient(135deg, #c9a55e 0%, #f0e0b8 45%, #a78bdc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-light {
  background: linear-gradient(135deg, var(--col-gold) 0%, var(--col-violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═══════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  min-height: 44px; /* touch target */
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

/* Gold button — used on login */
.btn-gold {
  background: linear-gradient(135deg, #c9a55e, #a8834a);
  color: #0b172e;
  box-shadow: 0 4px 20px rgba(201,165,94,0.4);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #d9b56e, #b8935a);
  box-shadow: 0 6px 32px rgba(201,165,94,0.6);
  transform: translateY(-1px);
}

.btn-gold:active { transform: translateY(0); }

/* Primary (portal) */
.btn-primary {
  background: linear-gradient(135deg, rgba(123,94,167,0.9), rgba(74,127,165,0.85));
  color: #fff;
  box-shadow: 0 4px 20px rgba(123,94,167,0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(143,114,187,1), rgba(94,147,185,1));
  box-shadow: 0 6px 28px rgba(123,94,167,0.5);
  transform: translateY(-1px);
}

/* Ghost — adapts to theme */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-2);
}

.btn-ghost:hover {
  background: var(--glass-bg);
  border-color: var(--glass-border-h);
  color: var(--text-1);
}

.btn-danger {
  background: transparent;
  border: 1px solid rgba(220,80,80,0.3);
  color: rgba(220,100,100,0.85);
}

.btn-danger:hover {
  background: rgba(220,80,80,0.08);
  border-color: rgba(220,80,80,0.5);
}

.btn-sm  { padding: 8px 16px; font-size: 0.8rem; min-height: 36px; }
.btn-lg  { padding: 16px 40px; font-size: 0.95rem; }
.btn-block { width: 100%; }

.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* Breathing glow for CTA */
@keyframes breathe-gold {
  0%, 100% { box-shadow: 0 4px 20px rgba(201,165,94,0.35); }
  50%       { box-shadow: 0 6px 40px rgba(201,165,94,0.65); }
}
.btn-breathe { animation: breathe-gold 4s ease-in-out infinite; }

/* ═══════════════════════════════════════════════════════
   FORM ELEMENTS — DEVICE FRIENDLY
   ═══════════════════════════════════════════════════════ */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem; /* 16px prevents iOS zoom */
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  outline: none;
  transition: var(--transition-fast);
  appearance: none;
  min-height: 44px;
}

.login-page input[type="email"],
.login-page input[type="text"] {
  background: rgba(255,255,255,0.85);
  color: #1a2540;
  -webkit-text-fill-color: #1a2540;
  caret-color: #1a2540;
  border-color: rgba(26,37,64,0.12);
}

.login-page input::placeholder { color: rgba(26,37,64,0.35); }

.login-page input:focus {
  border-color: rgba(184,134,74,0.45);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 0 0 3px rgba(184,134,74,0.10);
}

/* Chrome/Safari autofill override — keeps text dark on light card */
.login-page input:-webkit-autofill,
.login-page input:-webkit-autofill:hover,
.login-page input:-webkit-autofill:focus {
  -webkit-text-fill-color: #1a2540 !important;
  -webkit-box-shadow: 0 0 0 40px rgba(255,255,255,0.95) inset !important;
  caret-color: #1a2540;
}

.portal-page input[type="text"],
.portal-page input[type="email"],
.portal-page input[type="url"],
.portal-page input[type="datetime-local"],
.portal-page textarea,
.portal-page select {
  background: rgba(255,255,255,0.6);
  color: var(--text-1);
  border-color: rgba(0,0,0,0.08);
}

.portal-page input::placeholder,
.portal-page textarea::placeholder { color: var(--text-3); }

.portal-page input:focus,
.portal-page textarea:focus,
.portal-page select:focus {
  border-color: rgba(123,94,167,0.45);
  background: rgba(255,255,255,0.85);
  box-shadow: 0 0 0 3px rgba(123,94,167,0.1);
}

textarea { resize: vertical; min-height: 100px; line-height: 1.65; }
select option { background: #f6f3ee; color: #1a2540; }

/* ═══════════════════════════════════════════════════════
   NAVIGATION — PORTAL
   ═══════════════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.portal-page .nav {
  background: rgba(248,245,239,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 1px 12px rgba(0,0,0,0.06);
}

.nav-brand { display: flex; flex-direction: column; line-height: 1.1; }
.nav-brand .name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.portal-page .nav-brand .name { color: var(--col-gold); }

.nav-brand .subtitle {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 1px;
}

.portal-page .nav-brand .subtitle { color: var(--text-3); }

.nav-actions { display: flex; align-items: center; gap: 8px; }

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
}

.nav-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  transition: var(--transition-fast);
}

.portal-page .nav-hamburger span { background: var(--text-2); }
.portal-page .nav-hamburger:hover span { background: var(--text-1); }

@media (max-width: 860px) {
  .nav-hamburger { display: inline-flex; }
}

/* ═══════════════════════════════════════════════════════
   SIDEBAR — PORTAL
   ═══════════════════════════════════════════════════════ */
.sidebar {
  width: 230px;
  flex-shrink: 0;
  position: fixed;
  top: 64px;
  left: 0;
  bottom: 0;
  overflow-y: auto;          /* fallback if flex sizing is off */
  padding: 20px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 80;
  transition: transform var(--transition);
}

.portal-page .sidebar {
  background: rgba(248,245,239,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(0,0,0,0.06);
}

.sidebar-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0 12px;
  margin: 16px 0 6px;
}

.portal-page .sidebar-label { color: var(--text-3); }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: var(--transition-fast);
  text-decoration: none;
  min-height: 44px; /* touch */
}

.portal-page .sidebar-item:hover {
  background: rgba(0,0,0,0.04);
  color: var(--text-1);
}

.portal-page .sidebar-item.active {
  background: rgba(184,134,74,0.1);
  color: var(--col-gold);
  border: 1px solid rgba(184,134,74,0.2);
  font-weight: 600;
}

.sidebar-item .icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }

/* ─── Mobile sidebar ─── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0 !important; }
}

/* ═══════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════ */
.app-layout { display: flex; min-height: 100vh; padding-top: 64px; }

.main-content {
  flex: 1;
  margin-left: 230px;
  padding: 32px 32px;
  min-width: 0;
  max-width: 100%;
}

/* Cap content width on very wide screens so lines don't get too long */
@media (min-width: 1400px) { .main-content { padding: 32px 48px; } }
@media (max-width: 1100px) { .main-content { padding: 28px 24px; } }
@media (max-width: 860px)  { .main-content { padding: 24px 16px; } }
@media (max-width: 480px)  { .main-content { padding: 20px 14px; } }

/* On wide screens keep 3-col grid from becoming too wide */
@media (min-width: 1200px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 360px)); }
}

/* Panels */
.panel { display: none; }
.panel.active { display: block; }

/* Section header */
.section-header { margin-bottom: 28px; }
.section-header h2 { margin-bottom: 5px; }
.section-header p { color: var(--text-2); font-size: 0.92rem; max-width: 560px; }

/* ═══════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════ */
.card {
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  transition: var(--transition);
}

.portal-page .card {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 2px 16px rgba(0,0,0,0.07), inset 0 1px 0 rgba(255,255,255,0.95);
}

.portal-page .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,1);
  border-color: var(--glass-border-h);
}

.card-icon { font-size: 1.5rem; margin-bottom: 12px; display: block; }
.card h3 { margin-bottom: 6px; }
.card p  { color: var(--text-2); font-size: 0.9rem; line-height: 1.65; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

/* ═══════════════════════════════════════════════════════
   GRIDS
   ═══════════════════════════════════════════════════════ */
.grid    { display: grid; gap: 18px; }
.grid-2  { grid-template-columns: repeat(2, 1fr); }
.grid-3  { grid-template-columns: repeat(3, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

@media (max-width: 860px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) { .grid-auto { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════════════════
   PROGRESS
   ═══════════════════════════════════════════════════════ */
.progress-bar {
  height: 5px;
  background: rgba(0,0,0,0.06);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--col-gold), var(--col-violet));
  border-radius: var(--radius-pill);
  transition: width 0.8s ease;
}

/* ═══════════════════════════════════════════════════════
   WEEK CARDS
   ═══════════════════════════════════════════════════════ */
.week-card {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.portal-page .week-card {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(12px);
}

.portal-page .week-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(to bottom, var(--col-gold), var(--col-violet));
  opacity: 0;
  transition: opacity 0.3s;
}

.portal-page .week-card:hover::before,
.portal-page .week-card.current::before { opacity: 1; }

.portal-page .week-card.current {
  border-color: rgba(184,134,74,0.3);
  background: rgba(255,255,255,0.88);
}

.week-card.locked { opacity: 0.4; cursor: not-allowed; }
.week-card.completed { opacity: 0.7; }

.week-number { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 4px; }
.portal-page .week-number { color: var(--col-gold); }
.week-title { font-size: 0.92rem; font-weight: 600; margin-bottom: 3px; }
.week-desc  { font-size: 0.8rem; color: var(--text-2); }

/* ═══════════════════════════════════════════════════════
   VIDEO PLAYER
   ═══════════════════════════════════════════════════════ */
.player-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(0,0,0,0.06);
  border: 1px solid var(--glass-border);
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-wrap mux-player,
.player-wrap iframe,
.player-wrap video { width: 100%; height: 100%; border: none; }

.player-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 24px;
  text-align: center;
}

.portal-page .player-placeholder { color: var(--text-3); }
.portal-page .player-placeholder .play-icon { font-size: 2.5rem; opacity: 0.4; }

/* ═══════════════════════════════════════════════════════
   STATUS BADGES
   ═══════════════════════════════════════════════════════ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge.ready   { background: rgba(74,136,112,0.12); color: #3a7a5c; border: 1px solid rgba(74,136,112,0.25); }
.status-badge.pending { background: rgba(184,134,74,0.1);  color: var(--col-gold); border: 1px solid rgba(184,134,74,0.25); }
.status-badge.live    { background: rgba(200,60,60,0.1);   color: #c04040; border: 1px solid rgba(200,60,60,0.25); }

/* ═══════════════════════════════════════════════════════
   MOOD SELECTOR
   ═══════════════════════════════════════════════════════ */
.mood-selector { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.mood-btn {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: transparent;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
}

.portal-page .mood-btn { color: var(--text-2); }
.portal-page .mood-btn:hover, .portal-page .mood-btn.selected {
  background: rgba(184,134,74,0.1);
  border-color: rgba(184,134,74,0.3);
  color: var(--col-gold);
}

/* ═══════════════════════════════════════════════════════
   RECORDER
   ═══════════════════════════════════════════════════════ */
.recorder { display: flex; flex-direction: column; gap: 14px; }
.recorder-controls { display: flex; align-items: center; gap: 14px; }

.record-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  background: var(--glass-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.4rem;
  flex-shrink: 0;
}

.portal-page .record-btn:hover {
  background: rgba(184,134,74,0.12);
  border-color: rgba(184,134,74,0.4);
}

.record-btn.recording {
  background: rgba(200,60,60,0.1);
  border-color: rgba(200,60,60,0.5);
  animation: pulse-record 1.4s ease-in-out infinite;
}

@keyframes pulse-record {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200,60,60,0.4); }
  50%       { box-shadow: 0 0 0 10px rgba(200,60,60,0); }
}

.recording-status { font-size: 0.85rem; color: var(--text-2); }
.recording-status.live { color: #c04040; }

.audio-list { display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto; }
.audio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
}

.portal-page .audio-item { background: rgba(0,0,0,0.03); }
.audio-item audio { flex: 1; height: 32px; }

/* ═══════════════════════════════════════════════════════
   QUIZ
   ═══════════════════════════════════════════════════════ */
.quiz-progress-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 22px; }
.quiz-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  transition: background 0.3s;
}

.portal-page .quiz-dot            { background: rgba(0,0,0,0.1); }
.portal-page .quiz-dot.active     { background: var(--col-gold); }
.portal-page .quiz-dot.answered   { background: rgba(184,134,74,0.4); }

.quiz-question {
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 20px;
  line-height: 1.55;
  color: var(--text-1);
}

.quiz-options { display: flex; flex-direction: column; gap: 10px; }

.quiz-option {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: transparent;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  transition: var(--transition-fast);
  min-height: 48px;
  line-height: 1.5;
}

.portal-page .quiz-option { color: var(--text-1); }
.portal-page .quiz-option:hover   { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); }
.portal-page .quiz-option.selected { background: rgba(184,134,74,0.1); border-color: rgba(184,134,74,0.4); color: var(--col-gold); }
.portal-page .quiz-option.correct  { background: rgba(74,136,112,0.1); border-color: rgba(74,136,112,0.4); color: #3a7a5c; }

/* ═══════════════════════════════════════════════════════
   AVATAR
   ═══════════════════════════════════════════════════════ */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.portal-page .avatar {
  background: rgba(184,134,74,0.15);
  border: 1px solid rgba(184,134,74,0.25);
  color: var(--col-gold);
}

/* ═══════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  font-weight: 500;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.3s ease;
  pointer-events: all;
  backdrop-filter: blur(16px);
}

.toast.success { background: rgba(240,250,245,0.95); border: 1px solid rgba(74,136,112,0.3); color: #2e6a4a; box-shadow: var(--shadow-md); }
.toast.error   { background: rgba(250,240,240,0.95); border: 1px solid rgba(200,60,60,0.25);  color: #a04040; box-shadow: var(--shadow-md); }
.toast.info    { background: rgba(248,245,239,0.95); border: 1px solid rgba(184,134,74,0.25); color: var(--col-gold); box-shadow: var(--shadow-md); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px) scale(0.97); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@media (max-width: 480px) {
  .toast-container { left: 14px; right: 14px; bottom: 16px; }
  .toast { max-width: 100%; }
}

/* ═══════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  width: 100%;
  max-width: 520px;
  padding: 32px;
  border-radius: var(--radius-lg);
  transform: scale(0.96);
  transition: transform 0.3s ease;
}

.portal-page .modal {
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 24px 80px rgba(0,0,0,0.2);
}

.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-2);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}
.modal-close:hover { background: rgba(0,0,0,0.04); color: var(--text-1); }

/* ═══════════════════════════════════════════════════════
   UPLOAD ZONE
   ═══════════════════════════════════════════════════════ */
.upload-zone {
  border: 2px dashed var(--glass-border-h);
  border-radius: var(--radius-md);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.portal-page .upload-zone:hover, .portal-page .upload-zone.drag-over {
  border-color: rgba(184,134,74,0.45);
  background: rgba(184,134,74,0.04);
}

.upload-zone .upload-icon { font-size: 2.2rem; margin-bottom: 10px; opacity: 0.5; }

.upload-progress { height: 4px; background: rgba(0,0,0,0.06); border-radius: 2px; overflow: hidden; margin-top: 12px; display: none; }
.upload-progress.visible { display: block; }
.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--col-gold), var(--col-violet));
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s;
}

/* ═══════════════════════════════════════════════════════
   LESSON LIST ITEM
   ═══════════════════════════════════════════════════════ */
.lesson-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  transition: var(--transition-fast);
}

.portal-page .lesson-list-item {
  background: rgba(255,255,255,0.6);
}

.portal-page .lesson-list-item:hover { border-color: var(--glass-border-h); background: rgba(255,255,255,0.85); }

.lesson-thumb {
  width: 72px; height: 48px;
  border-radius: var(--radius-xs);
  background: rgba(0,0,0,0.05);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}

.lesson-info { flex: 1; min-width: 0; }
.lesson-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-meta  { font-size: 0.77rem; color: var(--text-2); }
.lesson-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════
   ACCORDION
   ═══════════════════════════════════════════════════════ */
.week-accordion { display: flex; flex-direction: column; gap: 10px; }

.week-accordion-item {
  border-radius: var(--radius-md);
  border: 1px solid rgba(0,0,0,0.08);
  overflow: hidden;
  background: rgba(255,255,255,0.75);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.week-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  transition: background var(--transition-fast);
  gap: 12px;
}

.portal-page .week-accordion-header {
  background: rgba(255,255,255,0.82);
}

.portal-page .week-accordion-header:hover {
  background: rgba(255,255,255,0.98);
}

.week-accordion-body {
  display: none;
  padding: 20px;
  border-top: 1px solid var(--glass-border);
}

.portal-page .week-accordion-body { background: rgba(255,255,255,0.5); }
.week-accordion-body.open { display: block; }

.week-accordion-chevron { transition: transform 0.3s; color: var(--text-2); font-size: 0.9rem; flex-shrink: 0; }
.week-accordion-header.open .week-accordion-chevron { transform: rotate(180deg); }

/* ── Week day-cards grid ── */
.wk-day-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.wk-day-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 10px 4px; border-radius: 10px; border: 1px solid rgba(0,0,0,0.1);
  text-align: center; gap: 3px; background: rgba(255,255,255,0.7);
}
.wk-day-card.has-anchor { border-color: rgba(201,165,94,0.4); background: rgba(201,165,94,0.06); }
.wk-day-card.no-anchor  { border-color: rgba(0,0,0,0.08); background: rgba(0,0,0,0.03); }
.wk-day-num   { font-size: 0.7rem; font-weight: 700; color: var(--text-1); }
.wk-day-status { font-size: 1rem; }
.wk-day-label { font-size: 0.58rem; color: var(--text-3); font-weight: 500; }
@media (max-width: 680px) { .wk-day-grid { grid-template-columns: repeat(4, 1fr); } }

/* ═══════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border-radius: 3px; }
.portal-page ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); }
.login-page ::-webkit-scrollbar-thumb  { background: rgba(255,255,255,0.12); }

/* ═══════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════ */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-4  { gap: 4px; }  .gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }  .gap-10 { gap: 10px; }
.gap-12 { gap: 12px; } .gap-14 { gap: 14px; }
.gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.gap-24 { gap: 24px; } .gap-32 { gap: 32px; }
.mt-8  { margin-top: 8px; }   .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }  .mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }  .mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom: 8px; }.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px;}
.text-center { text-align: center; }
.text-muted  { color: var(--text-2); }
.w-full { width: 100%; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--glass-border); margin: 20px 0; }
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(0,0,0,0.08);
  border-top-color: var(--col-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.login-page .spinner { border-color: rgba(255,255,255,0.1); border-top-color: var(--col-gold); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Animations ─── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up   { animation: fade-up 0.55s ease forwards; }
.delay-1   { animation-delay: 0.1s; opacity: 0; }
.delay-2   { animation-delay: 0.2s; opacity: 0; }
.delay-3   { animation-delay: 0.3s; opacity: 0; }
.delay-4   { animation-delay: 0.45s; opacity: 0; }
.delay-5   { animation-delay: 0.6s; opacity: 0; }

/* ─── Safe area (notched devices) ─── */
@supports (padding: env(safe-area-inset-bottom)) {
  .sidebar { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .toast-container { bottom: calc(24px + env(safe-area-inset-bottom)); }
}
