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

:root {
  --black: #000000;
  --surface: #0a0a0f;
  --surface-light: #111118;
  --gold: #F6D43F;
  --white: #ffffff;
  --white-soft: rgba(255,255,255,0.85);
  --muted: #9ca3af;
  --error: #ff4d4d;
  --success: #22c55e;
  --sidebar-width: 260px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--black);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  min-height: 100vh;
}

/* ═══════════════════════════
   SIDEBAR
   ═══════════════════════════ */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column;
  z-index: 40;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: clamp(0.6rem, 1.2vh, 1.25rem) 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand-top {
  display: flex; align-items: center; gap: 0.65rem;
  margin-bottom: clamp(0.15rem, 0.4vh, 0.4rem);
}

.sidebar-brand img {
  height: clamp(24px, 4vh, 36px); width: auto;
}

.sidebar-brand-name {
  font-family: 'Sora', sans-serif;
  font-weight: 700; font-size: clamp(0.6rem, 0.9vh, 0.75rem);
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--white);
  line-height: 1.2;
}

.sidebar-brand-title {
  font-family: 'Sora', sans-serif;
  font-weight: 600; font-size: clamp(0.55rem, 0.8vh, 0.65rem);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold);
  padding-left: 0;
}

.sidebar-nav {
  flex: 1; overflow-y: auto;
  padding: clamp(0.4rem, 0.8vh, 1rem) 0;
}

.sidebar-section-label {
  padding: clamp(0.2rem, 0.5vh, 0.5rem) 1.25rem;
  font-size: clamp(0.55rem, 0.75vh, 0.65rem); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--muted);
}

.sidebar-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: clamp(0.3rem, 0.6vh, 0.6rem) 1.25rem;
  color: var(--muted);
  text-decoration: none;
  font-size: clamp(0.7rem, 1vh, 0.875rem);
  transition: color 0.2s, background 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  color: var(--white);
  background: rgba(255,255,255,0.03);
}

.sidebar-link.active {
  color: var(--white);
  border-left-color: var(--gold);
  background: rgba(246,212,63,0.05);
}

.sidebar-link .check {
  width: clamp(14px, 2vh, 18px); height: clamp(14px, 2vh, 18px);
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: clamp(0.5rem, 0.75vh, 0.65rem);
}

.sidebar-link .check.done {
  background: var(--success);
  border-color: var(--success);
  color: var(--black);
}

.sidebar-cta {
  padding: clamp(0.5rem, 1vh, 1rem) 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-cta a {
  display: block;
  background: var(--gold);
  color: var(--black);
  font-weight: 700;
  font-size: clamp(0.65rem, 0.9vh, 0.8rem);
  text-align: center;
  padding: clamp(0.45rem, 0.8vh, 0.75rem) 1rem;
  border-radius: 4px;
  text-decoration: none;
  transition: filter 0.2s;
}

.sidebar-cta a:hover { filter: brightness(1.1); }

.sidebar-footer {
  padding: clamp(0.5rem, 1vh, 1rem) 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; justify-content: space-between;
}

.sidebar-footer a {
  color: var(--muted); font-size: clamp(0.65rem, 0.9vh, 0.8rem);
  text-decoration: none; transition: color 0.2s;
}

.sidebar-footer a:hover { color: var(--white); }

/* Mobile hamburger */
.mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(8px);
  padding: 1rem 1.25rem;
  z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  align-items: center; justify-content: space-between;
}

.mobile-header span {
  font-family: 'Sora', sans-serif;
  font-weight: 700; font-size: 0.8rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--white);
}

.hamburger {
  background: none; border: none; color: var(--white);
  cursor: pointer; padding: 0.25rem;
}

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 35;
}

/* ═══════════════════════════
   TOP NAV
   ═══════════════════════════ */
.topnav {
  position: fixed; top: 0; left: 0; right: 0;
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: 30;
}

.topnav-main {
  display: flex; align-items: center; gap: 0.25rem;
  padding: 0 clamp(1rem, 2vw, 1.5rem);
  height: clamp(42px, 5vh, 48px);
}

.topnav-brand {
  display: flex; align-items: center; gap: 0.5rem;
  margin-right: 1.5rem;
  text-decoration: none;
}

.topnav-brand img {
  height: clamp(36px, 5vh, 52px); width: auto;
}

.topnav-brand span {
  font-family: 'Sora', sans-serif;
  font-weight: 700; font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--white);
  white-space: nowrap;
}

.topnav-link {
  display: flex; align-items: center; gap: 0.4rem;
  padding: clamp(0.3rem, 0.5vh, 0.4rem) clamp(0.6rem, 0.8vw, 1rem);
  color: var(--muted);
  text-decoration: none;
  font-size: clamp(0.7rem, 0.85vw, 0.8rem); font-weight: 600;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.topnav-link:hover {
  color: var(--white);
  background: rgba(255,255,255,0.05);
}

.topnav-link.active {
  color: var(--gold);
  background: rgba(246,212,63,0.08);
}

.topnav-link svg { width: 16px; height: 16px; flex-shrink: 0; }

.topnav-right { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; }

/* Masterclass bar */
.masterclass-bar {
  display: flex; align-items: center; gap: clamp(0.15rem, 0.3vw, 0.25rem);
  padding: clamp(0.3rem, 0.5vh, 0.5rem) clamp(1rem, 2vw, 1.5rem);
  border-top: 1px solid rgba(255,255,255,0.04);
  overflow-x: auto;
  scrollbar-width: none;
}

.masterclass-bar::-webkit-scrollbar { display: none; }

.mc-link {
  display: inline-flex; align-items: center;
  padding: clamp(0.55rem, 0.9vh, 0.75rem) clamp(1.25rem, 1.8vw, 1.75rem);
  color: var(--muted);
  text-decoration: none;
  font-size: clamp(0.85rem, 1vw, 1rem); font-weight: 600;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,0.7);
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.mc-link:hover {
  color: var(--white);
  border-color: var(--white);
  background: rgba(255,255,255,0.08);
}

.mc-link.active {
  color: var(--black);
  background: var(--gold);
  border-color: var(--gold);
}

.mc-link.completed {
  color: var(--success);
  border-color: var(--success);
}

.mc-link.completed.active {
  color: var(--black);
  background: var(--gold);
  border-color: var(--gold);
}

/* ═══════════════════════════
   INVITE MODAL
   ═══════════════════════════ */
.invite-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center; justify-content: center;
  padding: 1.5rem;
}
.invite-overlay.open { display: flex; }

.invite-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1rem;
  padding: 2rem;
  width: 100%; max-width: 480px;
  position: relative;
  max-height: 90vh; overflow-y: auto;
}

.invite-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; color: var(--muted);
  font-size: 1.5rem; cursor: pointer; line-height: 1;
  transition: color 0.2s;
}
.invite-close:hover { color: var(--white); }

.invite-icon {
  width: 56px; height: 56px;
  background: rgba(246,212,63,0.12); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
}
.invite-icon svg { width: 28px; height: 28px; color: var(--gold); }

.invite-card h2 {
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 1.2rem;
  color: var(--white); margin-bottom: 0.35rem;
}

.invite-sub {
  color: var(--muted); font-size: 0.85rem; margin-bottom: 1.5rem; line-height: 1.5;
}

.invite-section { margin-bottom: 1.25rem; }
.invite-section label {
  display: block; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin-bottom: 0.5rem;
}

.invite-link-row {
  display: flex; gap: 0.5rem;
}
.invite-link-row input {
  flex: 1; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 6px;
  color: var(--white); font-size: 0.8rem; padding: 0.6rem 0.75rem;
  outline: none;
}
.invite-link-row button {
  background: var(--gold); color: var(--black);
  font-weight: 700; font-size: 0.8rem;
  padding: 0.6rem 1rem; border: none; border-radius: 6px;
  cursor: pointer; white-space: nowrap;
  transition: filter 0.2s;
}
.invite-link-row button:hover { filter: brightness(1.1); }

.invite-share-row { display: flex; gap: 0.5rem; }
.invite-share-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 6px;
  color: var(--white); font-size: 0.8rem; font-weight: 600;
  text-decoration: none; transition: border-color 0.2s, background 0.2s;
}
.invite-share-btn:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.2); }
.invite-share-btn svg { width: 16px; height: 16px; }

.invite-message {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px; padding: 0.85rem 1rem;
  font-size: 0.8rem; color: var(--white-soft);
  line-height: 1.6; margin-bottom: 0.5rem;
}

.invite-copy-msg {
  background: transparent; border: 1px solid rgba(255,255,255,0.15);
  color: var(--white); font-size: 0.75rem; font-weight: 600;
  padding: 0.45rem 0.85rem; border-radius: 4px; cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.invite-copy-msg:hover { border-color: var(--gold); color: var(--gold); }

/* ═══════════════════════════
   MAIN CONTENT
   ═══════════════════════════ */
.main {
  margin-left: 0;
  min-height: 100vh;
  padding: calc(var(--topnav-height, 90px) + clamp(1rem, 2vh, 2rem)) clamp(1.25rem, 3vw, 2.5rem) clamp(1.25rem, 3vw, 2.5rem);
}

.page-title {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  color: var(--white);
  margin-bottom: clamp(0.25rem, 0.5vh, 0.5rem);
}

.page-subtitle {
  color: var(--muted);
  font-size: clamp(0.85rem, 1vw, 0.95rem);
  margin-bottom: clamp(1rem, 2vh, 2rem);
}

/* ═══════════════════════════
   CARDS
   ═══════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.75rem;
  padding: clamp(1rem, 1.5vw, 1.5rem);
}

.card-hover {
  transition: transform 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
}

.card-hover:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.15);
}

/* ═══════════════════════════
   MODULE GRID
   ═══════════════════════════ */
.module-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
}

.module-card {
  text-decoration: none; color: inherit;
}

.module-number {
  font-family: 'Sora', sans-serif;
  font-weight: 700; font-size: 0.7rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.module-title {
  font-family: 'Sora', sans-serif;
  font-weight: 700; font-size: clamp(0.9rem, 1.1vw, 1.1rem);
  color: var(--white);
  margin-bottom: clamp(0.25rem, 0.5vh, 0.5rem);
}

.module-desc {
  color: var(--muted);
  font-size: clamp(0.75rem, 0.9vw, 0.85rem);
  line-height: 1.6;
  margin-bottom: clamp(0.5rem, 1vh, 1rem);
}

.module-status {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
}

.module-status.completed {
  background: rgba(34,197,94,0.15); color: var(--success);
}

.module-status.start {
  background: rgba(246,212,63,0.15); color: var(--gold);
}

.module-status.coming-soon {
  background: rgba(255,255,255,0.05); color: var(--muted);
}

/* ═══════════════════════════
   PROGRESS BAR
   ═══════════════════════════ */
.progress-wrap {
  margin-bottom: 2rem;
}

.progress-header {
  display: flex; justify-content: space-between;
  margin-bottom: 0.5rem;
}

.progress-label {
  font-size: 0.85rem; color: var(--muted);
}

.progress-count {
  font-family: 'Sora', sans-serif;
  font-weight: 700; font-size: 0.85rem;
  color: var(--gold);
}

.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ═══════════════════════════
   FORMS
   ═══════════════════════════ */
.form-group {
  margin-bottom: clamp(0.75rem, 1.5vh, 1.25rem);
}

.form-label {
  display: block;
  color: var(--white-soft);
  font-size: clamp(0.7rem, 0.85vw, 0.8rem); font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: clamp(0.25rem, 0.5vh, 0.5rem);
}

.form-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--white);
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.85rem, 1vw, 0.95rem);
  padding: clamp(0.6rem, 1vh, 0.85rem) 1rem;
  transition: border-color 0.2s;
  outline: none;
}

.form-input::placeholder { color: rgba(255,255,255,0.25); }

.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(246,212,63,0.15);
}

.form-error {
  color: var(--error);
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

/* ═══════════════════════════
   BUTTONS
   ═══════════════════════════ */
.btn-gold {
  display: inline-block;
  background: var(--gold); color: var(--black);
  font-weight: 700; font-size: clamp(0.85rem, 1vw, 1rem);
  padding: clamp(0.6rem, 1vh, 0.85rem) 1.5rem;
  border: none; border-radius: 4px;
  cursor: pointer; text-decoration: none;
  transition: filter 0.2s, transform 0.2s;
  text-align: center;
  width: 100%;
}

.btn-gold:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-gold:disabled {
  opacity: 0.5; cursor: not-allowed;
  transform: none; filter: none;
}

.btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--white);
  font-weight: 600; font-size: 0.9rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  cursor: pointer; text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
  text-align: center;
}

.btn-outline:hover {
  border-color: var(--gold); color: var(--gold);
}

/* ═══════════════════════════
   VIDEO PLAYER
   ═══════════════════════════ */
.video-wrap {
  border-radius: 0.75rem;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

.video-topbar {
  background: #18181b;
  padding: 0.75rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
}

.video-topbar-title {
  color: var(--white); font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.15em;
  font-weight: 600;
}

.video-area {
  position: relative;
  aspect-ratio: 16/9;
  background: #27272a;
  display: flex; align-items: center; justify-content: center;
}

.video-area iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: none;
}

.video-placeholder {
  text-align: center; color: var(--muted);
}

.video-placeholder svg {
  width: 64px; height: 64px;
  margin-bottom: 1rem; opacity: 0.3;
}

.video-placeholder p {
  font-size: 0.95rem;
}

.video-placeholder span {
  font-size: 0.8rem; display: block; margin-top: 0.25rem;
}

/* ═══════════════════════════
   TOAST
   ═══════════════════════════ */
.toast {
  position: fixed; top: 1.5rem; right: 1.5rem;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.5rem;
  padding: 0.85rem 1.25rem;
  font-size: 0.875rem;
  z-index: 100;
  transform: translateX(120%);
  transition: transform 0.3s ease;
}

.toast.show { transform: translateX(0); }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--error); color: var(--error); }

/* ═══════════════════════════
   AUTH PAGES (centered card)
   ═══════════════════════════ */
.auth-page {
  height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1rem, 3vh, 2rem);
  overflow-y: auto;
}

.auth-card {
  width: 100%; max-width: clamp(320px, 30vw, 420px);
}

.auth-brand {
  text-align: center; margin-bottom: clamp(1rem, 3vh, 2.5rem);
}

.auth-brand img {
  height: clamp(40px, 7vh, 72px); width: auto; margin-bottom: clamp(0.5rem, 1vh, 1rem);
}

.auth-brand span {
  font-family: 'Sora', sans-serif;
  font-weight: 700; font-size: clamp(0.75rem, 1vw, 1rem);
  letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--white);
  display: block;
}

.auth-heading {
  font-family: 'Sora', sans-serif;
  font-weight: 700; font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: var(--white);
  margin-bottom: clamp(0.25rem, 0.5vh, 0.5rem);
}

.auth-sub {
  color: var(--muted); font-size: clamp(0.8rem, 1vw, 0.9rem);
  margin-bottom: clamp(1rem, 2vh, 2rem);
}

.auth-footer {
  text-align: center; margin-top: clamp(0.75rem, 1.5vh, 1.5rem);
  color: var(--muted); font-size: clamp(0.75rem, 0.9vw, 0.85rem);
}

.auth-footer a {
  color: var(--gold); text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover { text-decoration: underline; }

/* Google Sign-In */
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  width: 100%;
  background: var(--white); color: #333;
  font-family: 'Inter', sans-serif;
  font-weight: 600; font-size: 0.95rem;
  padding: 0.85rem 1.5rem;
  border: none; border-radius: 4px;
  cursor: pointer;
  transition: filter 0.2s, transform 0.2s;
}

.google-btn:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

.google-btn svg { flex-shrink: 0; }

.auth-divider {
  display: flex; align-items: center; gap: 1rem;
  margin: clamp(0.75rem, 1.5vh, 1.5rem) 0;
  color: var(--muted); font-size: clamp(0.7rem, 0.85vw, 0.8rem);
}

.auth-divider::before,
.auth-divider::after {
  content: ''; flex: 1;
  height: 1px; background: rgba(255,255,255,0.1);
}

.auth-error {
  background: rgba(255,77,77,0.1);
  border: 1px solid rgba(255,77,77,0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--error);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  display: none;
}

.auth-error.show { display: block; }

.auth-success {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--success);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  display: none;
}

.auth-success.show { display: block; }

/* ═══════════════════════════
   LOADING SPINNER (Logo)
   ═══════════════════════════ */
.loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh;
}

.spinner {
  position: relative;
  width: 64px; height: 64px;
}

.spinner::before {
  content: '';
  position: absolute; inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(246,212,63,0.15);
  border-top-color: var(--gold);
  animation: spin 1s linear infinite;
}

.spinner img {
  width: 100%; height: 100%;
  object-fit: contain;
  animation: logoPulse 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(246,212,63,0.3));
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes logoPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.95); filter: drop-shadow(0 0 4px rgba(246,212,63,0.1)); }
  50% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 12px rgba(246,212,63,0.5)); }
}

/* ═══════════════════════════
   RESPONSIVE
   ═══════════════════════════ */
@media (max-width: 1024px) {
  .module-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .topnav-brand span { display: none; }
  .topnav-link span { display: none; }
  .topnav-link { padding: 0.4rem; }
  .masterclass-bar { padding: 0.3rem 0.75rem; }
  .main {
    padding: calc(var(--topnav-height, 80px) + 1rem) 1.25rem 2rem;
  }
}
