/* Infrina Academy — Modern Learning Platform */
:root {
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-mute: #94a3b8;
  --brand: #0891b2;
  --brand-dark: #0e7490;
  --brand-light: #22d3ee;
  --brand-lighter: #cffafe;
  --brand-ink: #ffffff;
  --accent: #10b981;
  --ok: #10b981;
  --err: #dc2626;
  --warn: #d97706;
  --line: #e2e8f0;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 1px 3px rgba(15,23,42,0.04), 0 4px 12px rgba(15,23,42,0.06);
  --shadow-lg: 0 4px 6px rgba(15,23,42,0.03), 0 12px 32px rgba(15,23,42,0.08);
  --gradient: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.menu-open { overflow: hidden; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink); margin: 0 0 .5em; line-height: 1.25; font-weight: 700; }
h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }
img { max-width: 100%; }

/* ============================================
   Header
   ============================================ */
.site-header {
  background: var(--panel);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand .brand-logo { height: 36px; width: auto; }
.brand .brand-text { font-size: 1.1rem; font-weight: 600; color: var(--brand); }

.main-nav {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.nav-link {
  padding: 10px 16px;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 15px;
  border-radius: 8px;
  transition: all 0.15s;
}
.nav-link:hover {
  color: var(--ink);
  background: var(--bg);
  text-decoration: none;
}

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

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--ink);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  z-index: 99;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.mobile-menu.open {
  transform: translateY(0);
}
.mobile-nav {
  display: flex;
  flex-direction: column;
  padding: 16px 24px;
}
.mobile-nav a {
  padding: 14px 0;
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover { text-decoration: none; color: var(--brand); }

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 72px;
  background: rgba(0,0,0,0.3);
  z-index: 98;
}
.mobile-overlay.show { display: block; }

@media (max-width: 900px) {
  .main-nav { display: none; }
  .header-actions .nav-link { display: none; }
  .mobile-menu-btn { display: block; }
  .mobile-menu { display: block; }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.15s;
  text-decoration: none;
}
.btn:hover {
  border-color: var(--ink-mute);
  text-decoration: none;
}
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}
.btn-outline {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn-outline:hover {
  border-color: var(--ink-mute);
  color: var(--ink);
}
.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
  border-radius: 12px;
}
.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

.linkish {
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.linkish:hover { color: var(--ink); text-decoration: underline; }
.inline-form { display: inline; }

/* ============================================
   Main Content Area
   ============================================ */
.site-main {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px;
  margin-top: 72px;
}
.site-main.home-main {
  max-width: 100%;
  padding: 0;
  margin-top: 72px;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: var(--ink);
  color: #fff;
  margin-top: auto;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 24px 48px;
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 64px;
}
.footer-brand .brand { margin-bottom: 16px; }
.footer-brand .brand-text { color: var(--brand-light); }
.footer-brand p {
  color: var(--ink-mute);
  font-size: 15px;
  max-width: 280px;
}
.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.footer-col h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.footer-col a {
  display: block;
  color: var(--ink-mute);
  font-size: 15px;
  padding: 6px 0;
  transition: color 0.15s;
}
.footer-col a:hover {
  color: #fff;
  text-decoration: none;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 24px;
  text-align: center;
}
.footer-bottom p {
  color: var(--ink-mute);
  font-size: 14px;
  margin: 0;
}
@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 48px 24px 32px;
  }
  .footer-links {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .footer-links {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ============================================
   Homepage Styles
   ============================================ */
.home-page { background: var(--panel); }

/* Hero Section */
.hero-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 24px 100px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-content h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  color: var(--ink);
}
.hero-content h1 span {
  color: var(--brand);
}
.hero-content .lead {
  font-size: 1.2rem;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 520px;
}
.hero-buttons {
  display: flex;
  gap: 16px;
  margin-bottom: 48px;
}
.hero-stats {
  display: flex;
  gap: 48px;
}
.hero-stat {
  text-align: left;
}
.hero-stat .number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}
.hero-stat .number span {
  color: var(--brand);
}
.hero-stat .label {
  font-size: 14px;
  color: var(--ink-mute);
  margin-top: 4px;
}

/* Hero Images */
.hero-images {
  position: relative;
  height: 500px;
}
.hero-card {
  position: absolute;
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero-card.main {
  width: 320px;
  height: 400px;
  top: 0;
  right: 0;
  background: linear-gradient(135deg, var(--brand-lighter) 0%, #e0f2fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-card.main .card-icon {
  font-size: 120px;
}
.hero-card.secondary {
  width: 260px;
  height: 320px;
  bottom: 0;
  left: 0;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-card.secondary .card-icon {
  font-size: 100px;
}
.hero-card.stat-card {
  padding: 16px 20px;
  width: auto;
  right: 20px;
  bottom: 80px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--brand-lighter);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-card .stat-info strong {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}
.stat-card .stat-info span {
  font-size: 13px;
  color: var(--ink-mute);
}

@media (max-width: 1024px) {
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 60px 24px 80px;
  }
  .hero-content h1 { font-size: 2.8rem; }
  .hero-content .lead { margin-inline: auto; }
  .hero-buttons { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-images { display: none; }
}
@media (max-width: 640px) {
  .hero-section { padding: 40px 20px 60px; }
  .hero-content h1 { font-size: 2.2rem; }
  .hero-buttons { flex-direction: column; }
  .hero-stats { flex-direction: column; gap: 24px; align-items: center; }
}

/* Trust Section */
.trust-section {
  background: var(--bg);
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.trust-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
}
.trust-item svg {
  color: var(--ok);
  flex-shrink: 0;
}

/* Features Section */
.features-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 100px 24px;
}
.section-header {
  text-align: center;
  margin-bottom: 64px;
}
.section-label {
  display: inline-block;
  background: var(--brand-lighter);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 16px;
}
.section-header p {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
}
.feature-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all 0.2s;
}
.feature-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-lg);
}
.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--brand-lighter);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}
.feature-card p {
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

/* How It Works */
.steps-section {
  background: var(--bg);
  padding: 100px 24px;
}
.steps-inner {
  max-width: 1280px;
  margin: 0 auto;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.step-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  position: relative;
}
.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.step-card h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}
.step-card p {
  font-size: 14px;
  margin: 0;
  line-height: 1.6;
}
@media (max-width: 900px) {
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .steps-grid { grid-template-columns: 1fr; }
}

/* Courses Section */
.courses-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 100px 24px;
}
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.course-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.2s;
  text-decoration: none;
  display: block;
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.course-thumb {
  height: 180px;
  background: linear-gradient(135deg, var(--brand-lighter) 0%, #e0f2fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.course-thumb .emoji {
  font-size: 64px;
}
.course-body {
  padding: 24px;
}
.course-body .badge {
  margin-bottom: 12px;
}
.course-body h3 {
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 8px;
}
.course-body p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
  color: var(--ink-soft);
}
.course-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-mute);
}
.course-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* CTA Section */
.cta-section {
  background: var(--gradient);
  padding: 80px 24px;
  text-align: center;
}
.cta-inner {
  max-width: 700px;
  margin: 0 auto;
}
.cta-section h2 {
  font-size: 2.5rem;
  color: #fff;
  margin-bottom: 16px;
}
.cta-section p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 32px;
}
.cta-section .btn-primary {
  background: #fff;
  color: var(--brand);
  border-color: #fff;
}
.cta-section .btn-primary:hover {
  background: var(--bg);
}
.cta-section .btn-outline {
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}
.cta-section .btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: #fff;
}

/* ============================================
   Panels & Forms (for other pages)
   ============================================ */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px;
}
.panel + .panel { margin-top: 24px; }
.panel-narrow { max-width: 480px; margin-inline: auto; }
.panel-medium { max-width: 720px; margin-inline: auto; }

.form-row { margin-bottom: 20px; }
.form-row label {
  display: block;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  font-size: 14px;
}
.form-row small {
  display: block;
  color: var(--ink-mute);
  font-size: 13px;
  margin-top: 6px;
}
.form-row input[type=text],
.form-row input[type=email],
.form-row input[type=password],
.form-row input[type=tel],
.form-row input[type=date],
.form-row input[type=number],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-lighter);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .form-row { margin: 0; }
.form-actions {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* Flash Messages */
.flash-stack { margin-bottom: 24px; display: grid; gap: 12px; }
.flash {
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid;
  font-size: 15px;
}
.flash-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.flash-info { background: #f0f9ff; border-color: #bae6fd; color: #075985; }

/* Badges */
.badge {
  display: inline-block;
  padding: 5px 12px;
  font-size: 12px;
  background: var(--brand-lighter);
  color: var(--brand-dark);
  border-radius: 20px;
  font-weight: 600;
}
.badge-ok { background: #dcfce7; color: #166534; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-err { background: #fee2e2; color: #991b1b; }

/* Captcha */
.captcha-row { display: flex; align-items: center; gap: 16px; }
.captcha-img { border-radius: 10px; border: 1px solid var(--line); }

/* ============================================
   Course Listing Page
   ============================================ */
.page-header {
  margin-bottom: 40px;
}
.page-header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}
.page-header p {
  font-size: 1.1rem;
}

/* ============================================
   Markdown Content
   ============================================ */
.md-body { font-size: 1.05rem; }
.md-body h1, .md-body h2, .md-body h3 { margin-top: 1.5em; }
.md-body .md-code {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  overflow-x: auto;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.7;
}
.md-body .md-code code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.md-body code {
  background: var(--bg-alt);
  color: var(--brand-dark);
  padding: .15em .5em;
  border-radius: 5px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .9em;
}
.md-body blockquote {
  border-left: 4px solid var(--brand);
  padding: .5rem 1.25rem;
  color: var(--ink-soft);
  background: var(--bg);
  border-radius: 0 10px 10px 0;
  margin: 1.5em 0;
}
.md-body a { text-decoration: underline; }
.md-body hr { border: none; border-top: 1px solid var(--line); margin: 2rem 0; }
.md-body .md-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.md-body .md-table th,
.md-body .md-table td {
  padding: 14px 18px;
  text-align: left;
  border: 1px solid var(--line);
}
.md-body .md-table th { background: var(--bg); font-weight: 600; color: var(--ink); }
.md-body .md-table td { background: var(--panel); color: var(--ink-soft); }
.md-body .md-table tr:hover td { background: var(--bg); }

/* Utilities */
.muted { color: var(--ink-mute); }
.monospace { font-family: ui-monospace, Menlo, Consolas, monospace; }
.text-center { text-align: center; }

/* Icons */
.icon { display: inline-block; vertical-align: -.15em; flex-shrink: 0; }
.icon-inline { width: 1em; height: 1em; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 28px; height: 28px; }
.icon-xl { width: 40px; height: 40px; }
.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--brand-lighter);
  color: var(--brand);
}

/* TOTP Setup */
.totp-setup { text-align: center; padding: 1rem 0; }
.totp-setup p { max-width: 400px; margin: 0 auto 1rem; }
.totp-qr { margin: 1.5rem 0; }
.totp-qr img {
  max-width: 220px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.totp-secret {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: var(--bg);
  padding: .75rem 1.25rem;
  border-radius: 10px;
  letter-spacing: 3px;
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}

/* Certificate Card */
.cert-card {
  background: linear-gradient(135deg, var(--brand-lighter) 0%, #e0f2fe 100%);
  border: 1px solid var(--brand);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.cert-card .title { font-weight: 700; }
.cert-card .cid {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--ink-soft);
}

/* Stepper */
.stepper {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  justify-content: center;
}
.stepper .step {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.stepper .step.active { background: var(--brand); color: #fff; }
.stepper .step.done { background: var(--ok); color: #fff; }

/* Section Index (for courses) */
.section-index { display: grid; gap: 8px; }
.section-index a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  transition: all 0.15s;
}
.section-index a:hover {
  border-color: var(--brand);
  text-decoration: none;
}
.section-index .done { color: var(--ok); }

/* ============================================
   Course Player Styles
   ============================================ */
.course-player {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 0;
  min-height: calc(100vh - 72px);
  background: var(--bg);
  margin: -48px calc(-50vw + 50%);
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  align-items: start;
}

.player-main {
  padding: 32px 48px;
  overflow-y: auto;
  max-height: calc(100vh - 72px);
  background: var(--bg);
}

.player-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.crumb { color: var(--ink-mute); }
.crumb:hover { color: var(--brand); text-decoration: none; }
.crumb-sep { color: var(--line); }

.course-header { margin-bottom: 28px; }
.course-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.course-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.module-tag {
  background: var(--brand-lighter);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
}
.module-tag.quiz { background: #e0f2fe; color: #0284c7; }

.course-meta-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-mute);
  font-size: 14px;
}
.meta-item svg { opacity: 0.6; }
.progress-badge { color: var(--ok); }

.video-section {
  margin-bottom: 28px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  max-width: min(100%, calc((100vh - 340px) * 16 / 9));
}
.video-section .infrina-player { border-radius: 16px; max-width: 100%; }

.content-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
.content-tabs .tab {
  background: none;
  border: none;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-mute);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.content-tabs .tab:hover { color: var(--ink); }
.content-tabs .tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.content-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px;
  margin-top: 24px;
}
.content-card h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 20px;
}

.lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  gap: 16px;
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.nav-btn:hover {
  background: var(--bg);
  border-color: var(--ink-mute);
  color: var(--ink);
  text-decoration: none;
}
.nav-btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.nav-btn.primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

/* Course Sidebar */
.course-sidebar {
  background: var(--panel);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 72px);
  position: sticky;
  top: 72px;
}
.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sidebar-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--ink-mute);
  cursor: pointer;
  padding: 4px;
}
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.module-group { border-bottom: 1px solid var(--line); }
.module-group:last-child { border-bottom: none; }
.module-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.15s;
}
.module-header:hover { background: var(--bg); }
.module-status {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.module-status svg { color: var(--ok); }
.module-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-mute);
}
.module-group.complete .module-status { background: #dcfce7; }
.module-group.current .module-status { background: var(--brand-lighter); }
.module-group.current .module-num { color: var(--brand); }
.module-info { flex: 1; min-width: 0; }
.module-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 2px;
}
.module-meta {
  font-size: 12px;
  color: var(--ink-mute);
}
.module-header .chevron {
  color: var(--ink-mute);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.module-header.active .chevron { transform: rotate(180deg); }

.module-lessons {
  display: none;
  padding: 0 0 8px;
  background: var(--bg);
}
.module-lessons.open { display: block; }
.lesson-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 12px 64px;
  color: var(--ink-soft);
  font-size: 14px;
  transition: all 0.15s;
  text-decoration: none;
}
.lesson-item:hover {
  background: rgba(0,0,0,0.03);
  color: var(--ink);
  text-decoration: none;
}
.lesson-item.current {
  background: var(--brand-lighter);
  color: var(--brand);
}
.lesson-item.done { color: var(--ok); }
.lesson-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lesson-icon svg { opacity: 0.7; }
.lesson-item.done .lesson-icon svg,
.lesson-item.current .lesson-icon svg { opacity: 1; }
.lesson-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg);
}
.progress-ring-wrapper {
  position: relative;
  width: 50px;
  height: 50px;
}
.progress-ring { transform: rotate(-90deg); }
.progress-ring-bg { stroke: var(--line); }
.progress-ring-fill {
  stroke: var(--brand);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s;
}
.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}
.sidebar-footer .progress-info {
  display: flex;
  flex-direction: column;
  font-size: 13px;
}
.sidebar-footer .progress-info strong { color: var(--ink); }
.sidebar-footer .progress-info span { color: var(--ink-mute); }

.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  background: var(--brand);
  color: #fff;
  border: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(8, 145, 178, 0.4);
  align-items: center;
  justify-content: center;
}

/* Quiz Styles */
.quiz-container { margin-top: 0; }
.quiz-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.quiz-header h2 { margin-bottom: 8px; }
.quiz-form { display: grid; gap: 20px; }
.quiz-intro { margin-bottom: 24px; }
.quiz-card {
  display: flex;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s;
}
.quiz-card.correct { border-color: var(--ok); background: #f0fdf4; }
.quiz-card.incorrect { border-color: var(--err); background: #fef2f2; }
.quiz-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--brand);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 15px;
}
.quiz-card.correct .quiz-number { background: var(--ok); }
.quiz-card.incorrect .quiz-number { background: var(--err); }
.quiz-body { flex: 1; }
.quiz-prompt {
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.quiz-options { display: grid; gap: 10px; }
.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.quiz-option:hover {
  background: var(--bg);
  border-color: var(--ink-mute);
}
.quiz-option input { display: none; }
.option-check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.quiz-option input:checked + .option-check {
  border-color: var(--brand);
  background: var(--brand);
}
.quiz-option input:checked + .option-check::after {
  content: '';
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
}
.option-text {
  flex: 1;
  color: var(--ink-soft);
  font-size: 15px;
}
.option-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
}
.option-badge.correct { background: var(--ok); color: #fff; }
.option-badge.wrong { background: var(--err); color: #fff; }
.quiz-option.correct-choice { border-color: var(--ok); background: #f0fdf4; }
.quiz-option.wrong-choice { border-color: var(--err); background: #fef2f2; }
.quiz-explanation {
  margin-top: 16px;
  padding: 14px 16px;
  background: #f0f9ff;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  color: #075985;
  font-size: 14px;
  line-height: 1.5;
}

/* Responsive Course Player */
@media (max-width: 1200px) {
  .course-player { grid-template-columns: 1fr 320px; }
  .player-main { padding: 24px 32px; }
}
@media (max-width: 1024px) {
  .course-player { grid-template-columns: 1fr; }
  .sidebar-toggle { display: flex; }
  .course-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 360px;
    max-width: 90vw;
    height: 100vh;
    z-index: 300;
    transition: right 0.3s ease;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.15);
  }
  .course-sidebar.open { right: 0; }
  .sidebar-close { display: block; }
  .player-main { max-height: none; padding: 24px; }
}
@media (max-width: 640px) {
  .player-main { padding: 16px; }
  .course-header h1 { font-size: 22px; }
  .course-title-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .course-meta-row { flex-direction: column; gap: 8px; }
  .content-card { padding: 20px; border-radius: 10px; }
  .content-tabs .tab { padding: 12px 14px; font-size: 13px; }
  .lesson-nav { flex-direction: column; }
  .nav-btn { width: 100%; justify-content: center; }
  .quiz-card { flex-direction: column; padding: 16px; }
  .sidebar-toggle { bottom: 16px; right: 16px; width: 48px; height: 48px; }
}

/* ==============================
   COURSE PAGE LAYOUT (MINIMAL FOOTER)
   ============================== */
body.course-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.course-main {
  flex: 1;
  padding: 0;
  max-width: none;
}
.course-footer {
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 12px 0;
  flex-shrink: 0;
}
.course-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-mute);
}
.course-footer-links {
  display: flex;
  gap: 20px;
}
.course-footer-links a {
  color: var(--ink-mute);
  text-decoration: none;
  transition: color 0.15s;
}
.course-footer-links a:hover {
  color: var(--brand);
}
@media (max-width: 640px) {
  .course-footer-inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}
