/* ============================================
   COURSE SITE — ON-BRAND DESIGN SYSTEM
   Patient Flow Toolkit / Happy Clinic Brand
   ============================================ */

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

:root {
  /* Brand Colors */
  --deep-teal: #0A6E6E;
  --deep-teal-light: #0d8a8a;
  --deep-teal-glow: rgba(10, 110, 110, 0.12);
  --warm-charcoal: #2D2D2D;
  --warm-white: #FAF7F2;
  --soft-gold: #C9A96E;
  --soft-gold-text: #9E8245;
  --soft-gold-glow: rgba(201, 169, 110, 0.15);
  --muted-coral: #D4796A;
  --muted-coral-hover: #c0624f;
  --light-warm-grey: #E8E4DF;
  --medium-warm-grey: #706B66;

  /* Functional */
  --bg-primary: var(--warm-white);
  --bg-dark: var(--warm-charcoal);
  --text-primary: var(--warm-charcoal);
  --text-secondary: var(--medium-warm-grey);
  --border-color: var(--light-warm-grey);

  /* Spacing */
  --sidebar-width: 320px;
  --font-main: 'Plus Jakarta Sans', sans-serif;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.7;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-main);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--warm-charcoal);
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--warm-white);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(10, 110, 110, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  bottom: -25%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(201, 169, 110, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.login-container {
  width: 100%;
  max-width: 440px;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--warm-white);
  border: 2px solid var(--light-warm-grey);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 16px 48px rgba(45, 45, 45, 0.08);
}

.login-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--deep-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 32px;
  box-shadow: 0 8px 24px rgba(10, 110, 110, 0.25);
}

.login-card h1 {
  font-size: 1.75rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--warm-charcoal);
}

.login-card .subtitle {
  color: var(--medium-warm-grey);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

.input-group {
  position: relative;
  margin-bottom: 16px;
}

.input-group input {
  width: 100%;
  padding: 14px 20px;
  background: var(--warm-white);
  border: 2px solid var(--light-warm-grey);
  border-radius: var(--radius-sm);
  color: var(--warm-charcoal);
  font-family: var(--font-main);
  font-size: 1rem;
  transition: border-color var(--transition-base);
  outline: none;
}

.input-group input::placeholder {
  color: var(--medium-warm-grey);
}

.input-group input:focus {
  border-color: var(--deep-teal);
}

.btn-primary {
  width: 100%;
  padding: 16px 32px;
  background: var(--muted-coral);
  color: var(--warm-white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 4px 15px rgba(212, 121, 106, 0.35);
}

.btn-primary:hover {
  background: var(--muted-coral-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 121, 106, 0.45);
}

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

.login-error {
  color: var(--muted-coral);
  font-size: 0.85rem;
  margin-top: 12px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.login-error.visible {
  opacity: 1;
}

/* ============================================
   COURSE LAYOUT
   ============================================ */

.course-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--warm-charcoal);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--warm-white);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.sidebar-header .course-meta {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.nav-section-label {
  padding: 16px 20px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
}

.nav-section-label.premium-label {
  color: var(--soft-gold);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--warm-white);
}

.nav-item.active {
  background: rgba(10, 110, 110, 0.15);
  border-left-color: var(--deep-teal);
  color: var(--warm-white);
}

.nav-item.locked {
  opacity: 0.55;
  cursor: pointer;
}

.nav-item.locked:hover {
  opacity: 0.75;
  background: rgba(201, 169, 110, 0.08);
}

.nav-item .nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.nav-item .nav-icon.free {
  background: rgba(10, 110, 110, 0.2);
  color: #2BBCBC;
}

.nav-item .nav-icon.locked-icon {
  background: rgba(201, 169, 110, 0.15);
  color: var(--soft-gold);
}

.nav-item .nav-icon.unlocked {
  background: rgba(10, 110, 110, 0.2);
  color: #2BBCBC;
}

.nav-item .nav-title {
  flex: 1;
  font-weight: 600;
  line-height: 1.3;
}

.nav-item .lock-badge {
  font-size: 0.7rem;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-logout {
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-main);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--warm-white);
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 40px 48px;
  background: var(--warm-white);
}

/* --- Video Player --- */
.video-section {
  max-width: 860px;
  margin: 0 auto;
}

.video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: var(--warm-charcoal);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 28px;
  border: 1px solid var(--light-warm-grey);
  box-shadow: 0 8px 30px rgba(45, 45, 45, 0.1);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-title {
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--warm-charcoal);
  letter-spacing: -0.03em;
}

.video-description {
  color: var(--medium-warm-grey);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 24px;
}

.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.btn-lesson-nav {
  padding: 10px 20px;
  background: var(--warm-white);
  border: 2px solid var(--light-warm-grey);
  border-radius: var(--radius-sm);
  color: var(--medium-warm-grey);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-lesson-nav:hover {
  border-color: var(--deep-teal);
  color: var(--deep-teal);
}

.btn-lesson-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ============================================
   LOCKED CONTENT — BLURRED PREVIEW + OVERLAY
   ============================================ */

.locked-overlay {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
}

/* Blurred video preview wrapper */
.locked-video-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 28px;
  border: 1px solid rgba(201, 169, 110, 0.25);
}

.locked-video-wrapper .video-container {
  margin-bottom: 0;
  border: none;
  border-radius: 0;
  filter: blur(12px) brightness(0.5);
  pointer-events: none;
  transform: scale(1.05);
  /* prevents blur edge artifacts */
}

/* Lock overlay on top of blurred video */
.locked-video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  text-align: center;
  padding: 20px;
  background: rgba(45, 45, 45, 0.25);
}

.lock-icon-large {
  font-size: 52px;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 16px rgba(201, 169, 110, 0.4));
}

.locked-video-overlay h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--warm-white);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.locked-video-overlay p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.6;
  max-width: 380px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.locked-video-overlay .email-link {
  margin-bottom: 12px;
}

.btn-upgrade-small {
  display: inline-block;
  padding: 8px 16px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-upgrade-small:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--warm-white);
  border-color: rgba(255, 255, 255, 0.5);
}

.email-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--muted-coral);
  color: var(--warm-white);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: all var(--transition-base);
  box-shadow: 0 4px 15px rgba(212, 121, 106, 0.4);
}

.email-link:hover {
  background: var(--muted-coral-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 121, 106, 0.5);
  color: var(--warm-white);
}

/* ============================================
   UPGRADE MODAL — EMAIL CTA VERSION
   ============================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(45, 45, 45, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--warm-white);
  border: 2px solid var(--deep-teal);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-slow);
  box-shadow: 0 32px 80px rgba(45, 45, 45, 0.2);
}

.modal-backdrop.active .modal {
  transform: scale(1) translateY(0);
}

.modal-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.modal h3 {
  font-size: 1.3rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--warm-charcoal);
  margin-bottom: 8px;
}

.modal p {
  color: var(--medium-warm-grey);
  font-size: 0.95rem;
  margin-bottom: 24px;
  line-height: 1.6;
}

.modal .email-link {
  width: 100%;
  justify-content: center;
  padding: 16px 32px;
}

.modal-close {
  margin-top: 16px;
  background: none;
  border: none;
  color: var(--medium-warm-grey);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 8px;
  font-family: var(--font-main);
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--warm-charcoal);
}

/* ============================================
   MOBILE HAMBURGER
   ============================================ */

.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--warm-charcoal);
  z-index: 200;
  padding: 0 16px;
  align-items: center;
  gap: 12px;
}

.hamburger {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: var(--warm-white);
  font-size: 1.2rem;
  cursor: pointer;
}

.mobile-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--warm-white);
  text-transform: uppercase;
}

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

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.4s ease forwards;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 72px 16px 32px;
  }

  .video-title {
    font-size: 1.2rem;
  }

  .login-card {
    padding: 36px 24px;
  }

  .upgrade-email-info {
    padding: 24px 16px;
  }
}

@media (max-width: 480px) {
  .lesson-nav {
    flex-direction: column;
  }
}