/* Dalisa.lk - Core stylesheet. Royal Blue & Gold theme (overridable via CSS vars from admin settings) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Poppins:wght@600;700;800&display=swap');
:root {
  --color-primary: #1E3A8A;      /* royal blue */
  --color-primary-dark: #142a63;
  --color-secondary: #D4AF37;    /* gold */
  --color-secondary-light: #f0d878;
  --color-bg: #f4f6fb;
  --color-surface: #ffffff;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-success: #16a34a;
  --color-danger: #dc2626;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 24px rgba(30, 58, 138, 0.09);
  --shadow-md: 0 14px 32px rgba(30, 58, 138, 0.14);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.18);
  --font: 'Inter', 'Segoe UI', 'Noto Sans Sinhala', 'Noto Sans Tamil', system-ui, -apple-system, sans-serif;
  --font-heading: 'Poppins', 'Inter', 'Segoe UI', 'Noto Sans Sinhala', 'Noto Sans Tamil', system-ui, sans-serif;
  --gradient-brand: linear-gradient(135deg, var(--color-primary) 0%, #6d28d9 55%, #a855f7 100%);
  --gradient-course-a: linear-gradient(135deg, #f5e6f0 0%, #eef1fb 45%, #e4f5ee 100%);
  --gradient-course-b: linear-gradient(135deg, #eef2ff 0%, #f5e6f0 55%, #fdf2e9 100%);
  --gradient-course-c: linear-gradient(135deg, #e4f5ee 0%, #e4e6f8 55%, #f5e6f0 100%);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); letter-spacing: -0.02em; }
a { color: var(--color-primary); text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: none; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, opacity .15s ease, background .18s ease;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--color-primary); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--color-primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-gold { background: linear-gradient(135deg, var(--color-secondary-light), var(--color-secondary)); color: #1a1a1a; box-shadow: 0 8px 20px rgba(212,175,55,.28); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(212,175,55,.4); }
.btn-outline { background: transparent; border: 2px solid var(--color-primary); color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }
.btn-outline-light { background: transparent; border: 2px solid rgba(255,255,255,0.7); color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.15); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(220,38,38,.3); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn:focus-visible { outline: 3px solid rgba(30,58,138,.35); outline-offset: 2px; }

/* Top navigation */
.site-header {
  background: linear-gradient(135deg, #1a1040 0%, #2d1b69 40%, #4c1d95 70%, #1e1b4b 100%);
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.site-header .nav-wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; max-width: 1180px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 20px; }
.brand img { height: 36px; width: auto; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  color: rgba(255,255,255,.9); padding: 10px 14px; border-radius: 999px; font-weight: 600; font-size: 14.5px;
}
.nav-links a.active, .nav-links a:hover { background: rgba(255,255,255,.14); color: #fff; }
.nav-links a.badge-credits { background: var(--color-secondary); color: #1a1a1a; }
.hamburger {
  display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px;
}
.nav-overlay { display: none; }
.nav-close { display: none; }
.hamburger span { width: 26px; height: 3px; background: #fff; border-radius: 2px; }
.lang-switch { display: flex; gap: 4px; background: rgba(255,255,255,.12); border-radius: 999px; padding: 4px; }
.lang-switch a { padding: 6px 10px; font-size: 13px; border-radius: 999px; color: rgba(255,255,255,.85); }
.lang-switch a.active { background: #fff; color: var(--color-primary); }

/* On desktop, push the logo to the far left and nav/lang-switch/user-menu to the far right of the screen */
@media (min-width: 901px) {
  .site-header .nav-wrap { max-width: none; padding-left: 30px; padding-right: 30px; }
}

/* Sliding mobile nav */
@media (max-width: 900px) {
  .hamburger { display: flex; }
  .nav-links {
    position: fixed; top: 0; right: -280px; height: 100vh; width: 280px; z-index: 950;
    background: var(--color-primary-dark); flex-direction: column; align-items: stretch;
    padding: 80px 20px 20px; transition: right .3s ease; box-shadow: -8px 0 24px rgba(0,0,0,.2);
  }
  .nav-links.open { right: 0; }
  .nav-links a { padding: 14px 16px; }
  .nav-close {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 20px; right: 20px; background: rgba(255,255,255,.12); border: none;
    color: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 16px; cursor: pointer;
  }
  .nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 900; }
  .nav-overlay.open { display: block; }
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #1a1040 0%, #2d1b69 40%, #4c1d95 70%, #1e1b4b 100%);
  color: #fff; padding: 80px 0; position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; right: -80px; top: -80px; width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,55,.35), transparent 70%);
}
.hero::before {
  content: ''; position: absolute; left: -100px; bottom: -120px; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(236,72,153,.22), transparent 70%);
}
.hero .container { display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; z-index: 2; }
.hero h1 { font-size: 55px; margin: 0 0 16px; line-height: 1.2; max-width: 800px; }
.hero p { font-size: 17px; color: rgba(255,255,255,.9); margin: 0 auto 28px;}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25); color: #fff; font-weight: 600; font-size: 13.5px;
  padding: 8px 16px; border-radius: 999px; margin-bottom: 18px; backdrop-filter: blur(4px);
}
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; justify-content: center; }
.hero-stat-chip {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); color: #fff;
  font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px;
  transition: transform .2s ease, background .2s ease; animation: chipFadeIn .5s ease both;
}
.hero-stat-chip:hover { transform: translateY(-3px); background: rgba(255,255,255,.2); }
.hero-stats .hero-stat-chip:nth-child(2) { animation-delay: .08s; }
.hero-stats .hero-stat-chip:nth-child(3) { animation-delay: .16s; }
.hero-stats .hero-stat-chip:nth-child(4) { animation-delay: .24s; }
@keyframes chipFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.hero-showcase { display: flex; align-items: center; justify-content: center; gap: 40px; margin-top: 46px; flex-wrap: wrap; }
.hero-showcase-side { display: flex; flex-direction: column; gap: 20px; }
.hero-showcase-side.hero-showcase-right { flex-direction: column; }
.hero-showcase-side .hero-showcase-badge:nth-child(2) { align-self: flex-end; }
.hero-showcase-badge {
  width: 62px; height: 62px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 26px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(4px); animation: floatY 3.6s ease-in-out infinite;
}
.hero-showcase-left .hero-showcase-badge:nth-child(1) { animation-delay: 0s; }
.hero-showcase-left .hero-showcase-badge:nth-child(2) { animation-delay: .6s; }
.hero-showcase-right .hero-showcase-badge:nth-child(1) { animation-delay: .3s; }
.hero-showcase-right .hero-showcase-badge:nth-child(2) { animation-delay: .9s; }
.hero-mock-card {
  background: #fff; color: var(--color-text); border-radius: 20px; box-shadow: var(--shadow-lg);
  padding: 22px 26px; width: 300px; transform: rotate(-3deg); transition: transform .3s ease;
}
.hero-mock-card:hover { transform: rotate(0deg) translateY(-4px); }
.hero-mock-topbar { display: flex; gap: 6px; margin-bottom: 14px; }
.hero-mock-topbar span { width: 9px; height: 9px; border-radius: 50%; background: #e5e7eb; }
.hero-mock-topbar span:first-child { background: #f87171; }
.hero-mock-topbar span:nth-child(2) { background: #fbbf24; }
.hero-mock-topbar span:nth-child(3) { background: #34d399; }
.hero-mock-label { font-size: 12.5px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .03em; margin: 0 0 8px; text-align: left; }
.hero-mock-q { font-size: 22px; font-weight: 800; margin: 0 0 16px; text-align: left; }
.hero-mock-answers { display: flex; gap: 8px; }
.hero-mock-answers span {
  flex: 1; text-align: center; padding: 10px 0; border-radius: 10px; background: var(--color-bg);
  font-weight: 700; font-size: 15px; border: 2px solid transparent;
}
.hero-mock-answers .is-correct { background: #dcfce7; border-color: var(--color-success); color: #15803d; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@media (max-width: 900px) {
  .hero h1 { font-size: 32px; }
  .hero-showcase { gap: 24px; margin-top: 32px; }
}
@media (max-width: 640px) {
  .hero-showcase-side { display: none; }
}

/* Sections */
section { padding: 60px 0; }
.bg-soft-gradient {
  background: linear-gradient(135deg, #f5e6f0 0%, #ece4f4 12%, #e4e6f8 28%, #dfe9fb 45%, #e2f0f5 60%, #e4f5ee 78%, #ecf7e9 100%);
  position: relative; overflow: hidden;
}
.bg-soft-gradient::before {
  content: ''; position: absolute; top: -60px; right: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,.14), transparent 70%); pointer-events: none;
}
.bg-soft-gradient::after {
  content: ''; position: absolute; bottom: -80px; left: -60px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,55,.14), transparent 70%); pointer-events: none;
}
.bg-soft-gradient .container { position: relative; z-index: 1; }
.section-dark {
  background: linear-gradient(135deg, var(--color-primary) 0%, #4c1d95 60%, #1e1b4b 100%);
  position: relative; overflow: hidden;
}
.section-dark::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 10% 15%, rgba(255,255,255,.08), transparent 40%),
              radial-gradient(circle at 90% 85%, rgba(212,175,55,.14), transparent 45%);
}
.section-dark .container { position: relative; z-index: 2; }
.section-dark .section-title h2 { color: #fff; }
.section-dark .section-title p { color: rgba(255,255,255,.75); }
.container > h1 { text-align: center; }
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 30px; margin-bottom: 10px; }
.section-title p { color: var(--color-text-muted); margin: 0 auto; }

/* Numbered step timeline (about.php "How to Use the Platform") */
.step-grid { position: relative; }
.step-grid::before {
  content: ''; position: absolute; top: 34px; left: 12.5%; right: 12.5%; height: 2px; z-index: 0;
  background: repeating-linear-gradient(90deg, rgba(124,58,237,.35) 0 10px, transparent 10px 18px);
}
.step-grid .card { position: relative; z-index: 1; }
@media (max-width: 900px) { .step-grid::before { display: none; } }

.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid rgba(15, 23, 42, .04);
  padding: 26px; transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.skill-card { text-align: center; }
.skill-card h3 { margin: 0 0 8px; font-size: 18px; }
.skill-card p { color: var(--color-text-muted); font-size: 14px; margin: 0; }

/* Gradient circle icon badge - used on about.php skill/benefit/step cards */
.icon-badge {
  width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%; font-size: 32px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(124,58,237,.14), rgba(212,175,55,.16));
  box-shadow: 0 8px 20px rgba(124,58,237,.14);
  transition: transform .25s ease;
}
.card:hover .icon-badge { transform: scale(1.08) rotate(-4deg); }

.feature-card { text-align: center; position: relative; overflow: hidden; }
.feature-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 4px 4px 0 0;
  background: linear-gradient(90deg, var(--color-primary), #a855f7, var(--color-secondary));
  transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.feature-card:hover::before { transform: scaleX(1); }
.feature-icon-circle {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; font-size: 30px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(30,58,138,.1), rgba(168,85,247,.12));
  transition: transform .25s ease;
}
.feature-card:hover .feature-icon-circle { transform: scale(1.1) rotate(-4deg); }
.feature-card h3 { margin: 0 0 8px; font-size: 18px; }
.feature-card p { color: var(--color-text-muted); font-size: 14px; margin: 0; }

/* Course cards (Featured Courses on index.php, listing on courses.php) - light gradient, interactive, icon badge, no ribbon */
.course-card {
  text-align: left; overflow: hidden; border: 1px solid rgba(124,58,237,.12);
  background: var(--gradient-course-a); padding: 28px 26px;
}
.course-card:nth-of-type(3n+2) { background: var(--gradient-course-b); }
.course-card:nth-of-type(3n+3) { background: var(--gradient-course-c); }
.course-card:hover { transform: translateY(-6px) scale(1.015); box-shadow: var(--shadow-lg); }
.course-icon-badge {
  width: 56px; height: 56px; border-radius: 16px; font-size: 27px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
  background: var(--gradient-brand); color: #fff; box-shadow: 0 10px 22px rgba(109,40,217,.28);
  transition: transform .25s ease;
}
.course-card:hover .course-icon-badge { transform: rotate(-6deg) scale(1.08); }
.course-card h3 { margin: 0 0 8px; font-size: 19px; }
.course-card p { color: var(--color-text-muted); font-size: 14px; margin: 0 0 16px; min-height: 42px; }
.course-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.course-card-meta span {
  font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.75); color: var(--color-primary-dark); border: 1px solid rgba(124,58,237,.18);
}

/* Topic cards on course.php - styled like a mini pricing box */
.topic-pricing-card {
  border: 2px solid rgba(124,58,237,.16); text-align: left;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.topic-pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(124,58,237,.4); }
.topic-level-badge {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: var(--gradient-brand); color: #fff; padding: 4px 12px; border-radius: 999px; margin-bottom: 12px;
}
.topic-difficulty { color: var(--color-secondary); font-size: 15px; letter-spacing: 2px; margin: 0 0 10px; }
.topic-code-block {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--color-bg); border: 1.5px dashed rgba(124,58,237,.32); border-radius: 12px;
  padding: 12px 16px; margin: 16px 0;
}
.topic-code-block .topic-code-label { font-size: 11px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.topic-code-block code { font-family: var(--font-heading); font-weight: 800; font-size: 18px; color: var(--color-primary); }
.topic-focus-list { list-style: none; padding: 0; margin: 0 0 18px; }
.topic-focus-list li { padding: 5px 0; font-size: 13.5px; color: var(--color-text); }
.topic-focus-list li::before { content: '✅ '; }

/* Light-background pill chip - for use on light sections where hero-stat-chip's white text wouldn't be legible */
.chip-light {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
  padding: 8px 14px; border-radius: 999px; background: rgba(124,58,237,.08); color: var(--color-primary-dark);
  border: 1px solid rgba(124,58,237,.16);
}

.pricing-wrap { max-width: 760px; margin: 0 auto; }
.pricing-card { text-align: center; border: 2px solid var(--color-secondary); position: relative; overflow: visible; padding: 40px 44px; }
.pricing-ribbon {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--color-secondary-light), var(--color-secondary)); color: #1a1a1a;
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: 6px 18px; border-radius: 999px; box-shadow: 0 6px 16px rgba(212,175,55,.35);
}
.pricing-card .price { font-size: 46px; font-weight: 800; color: var(--color-primary); margin: 10px 0 2px; }
.pricing-card .price small { font-size: 16px; color: var(--color-text-muted); font-weight: 500; }
.pricing-subline { color: var(--color-text-muted); font-size: 14px; margin: 0 0 14px; }
.pricing-card ul {
  list-style: none; padding: 0; text-align: left; margin: 20px 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 28px;
}
.pricing-card ul li { padding: 8px 0; border-bottom: 1px dashed #eee; }
.pricing-card ul li::before { content: '✅ '; }
.pricing-card ul li:last-child:nth-child(odd) { grid-column: span 2; }
@media (max-width: 640px) {
  .pricing-card { padding: 30px 24px; }
  .pricing-card ul { grid-template-columns: 1fr; }
}

.final-cta {
  background: linear-gradient(135deg, var(--color-primary) 0%, #4c1d95 55%, #9d174d 120%);
  color: #fff; text-align: center; position: relative; overflow: hidden;
}
.final-cta::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 15% 20%, rgba(255,255,255,.12), transparent 40%),
              radial-gradient(circle at 85% 80%, rgba(255,255,255,.1), transparent 45%);
}
.final-cta .container { position: relative; z-index: 2; }
.final-cta h2 { color: #fff; font-size: 30px; margin: 0 0 14px; }
.final-cta p { color: rgba(255,255,255,.85); max-width: 600px; margin: 0 auto 26px; }
.hero-eyebrow-light { margin-bottom: 20px; }

/* Forms */
.auth-wrap { max-width: 460px; margin: 60px auto; padding: 0 20px; }
.form-group { margin-bottom: 18px; min-width: 0; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
input[type=text], input[type=tel], input[type=password], input[type=date], input[type=number], input[type=email], input[type=url], select, textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid #d9deea; border-radius: 10px; font-size: 15px; font-family: inherit;
  background: #fff; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--color-primary); }

/* Styled file upload (native input hidden, visible label acts as the control) */
.file-upload { position: relative; }
.file-upload input[type=file] {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.file-upload-label {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 1.5px dashed #d9deea;
  border-radius: 10px; font-size: 14.5px; font-family: inherit; background: #fff; color: var(--color-text-muted);
  transition: border-color .15s, background .15s;
}
.file-upload:hover .file-upload-label { border-color: var(--color-primary); background: var(--color-bg); }
.file-upload-label .file-upload-icon { font-size: 18px; flex-shrink: 0; }
.file-upload-label .file-upload-name { font-weight: 600; color: var(--color-text); }
.help-text { font-size: 12.5px; color: var(--color-text-muted); margin-top: 4px; }
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 18px; font-size: 14.5px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* Dashboard app-shell (used by both student dashboard pages and the admin panel) */
.dashboard-layout { display: grid; grid-template-columns: 260px 1fr; gap: 0; align-items: start; min-height: calc(100vh - 64px); }
.sidebar {
  background: linear-gradient(180deg, var(--color-primary), var(--color-primary-dark));
  padding: 22px 14px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 8px; color: #fff; font-family: var(--font-heading); font-weight: 700; font-size: 15px; padding: 6px 12px 18px; opacity: .92; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); color: rgba(255,255,255,.75); font-weight: 600; margin-bottom: 4px; font-size: 14.5px; transition: background .15s ease, color .15s ease; }
.sidebar a.active, .sidebar a:hover { background: rgba(255,255,255,.14); color: #fff; }
.sidebar a.active { box-shadow: inset 3px 0 0 var(--color-secondary); }
.dashboard-main { padding: 30px 32px 50px; min-width: 0; }
.dashboard-main section { padding: 0 0 24px; }
.dashboard-main .container { max-width: 100%; padding: 0; }
@media (max-width: 900px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-layout .sidebar {
    position: fixed; top: 0; left: -280px; width: 270px; height: 100vh; z-index: 1100;
    transition: left .3s ease; box-shadow: 8px 0 30px rgba(0,0,0,.3);
  }
  .dashboard-layout .sidebar.open { left: 0; }
  .dashboard-main { padding: 20px 16px 40px; }
}

.stat-card { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(15,23,42,.04); padding: 22px; }
.stat-card .value { font-size: 28px; font-weight: 800; color: var(--color-primary); font-family: var(--font-heading); }
.stat-card .label { color: var(--color-text-muted); font-size: 13.5px; }

.credit-badge {
  display: inline-flex; align-items: center; gap: 6px; background: var(--color-secondary); color: #1a1a1a;
  padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 14px;
}

/* User menu (dashboard topbar avatar dropdown) */
.user-menu { position: relative; }
.user-menu-btn {
  display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); border: none;
  color: #fff; padding: 6px 14px 6px 6px; border-radius: 999px; cursor: pointer; font-weight: 600;
  font-size: 14px; font-family: inherit; transition: background .15s ease;
}
.user-menu-btn:hover { background: rgba(255,255,255,.22); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--color-secondary); color: #1a1a1a;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.user-menu-chevron { font-size: 10px; opacity: .8; transition: transform .2s ease; }
.user-menu.open .user-menu-chevron { transform: rotate(180deg); }
.user-menu-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; background: #fff; border-radius: 14px;
  box-shadow: var(--shadow-lg); min-width: 230px; padding: 8px; display: none; z-index: 1200;
}
.user-menu.open .user-menu-dropdown { display: block; }
.user-menu-dropdown a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--color-text); font-weight: 600; font-size: 14px; margin: 0; white-space: nowrap; }
.user-menu-dropdown a:hover { background: var(--color-bg); }
.user-menu-dropdown .divider { height: 1px; background: #eef0f5; margin: 6px 4px; }
@media (max-width: 640px) { .user-name-label { display: none; } }

.progress-bar { background: #e5e9f3; border-radius: 999px; height: 12px; overflow: hidden; }
.progress-bar-fill { background: linear-gradient(90deg, var(--color-primary), var(--color-secondary)); height: 100%; border-radius: 999px; }

.table-responsive { width: 100%; overflow-x: auto; border-radius: var(--radius); }
table.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); }
table.data-table th, table.data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #eef0f5; font-size: 14px; white-space: nowrap; }
table.data-table th { background: var(--color-bg); font-weight: 700; }

/* Quiz player */
.quiz-question-box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; max-width: 720px; margin: 0 auto; }
.quiz-timer { font-weight: 800; font-size: 20px; color: var(--color-danger); }
.option-btn {
  display: block; width: 100%; text-align: left; padding: 14px 18px; margin-bottom: 10px; border-radius: 12px;
  border: 2px solid #e2e6f0; background: #fff; font-size: 15px; cursor: pointer; transition: all .15s;
}
.option-btn:hover { border-color: var(--color-primary); }
.option-btn.selected { border-color: var(--color-primary); background: #eef2ff; }
.option-btn.correct { border-color: var(--color-success); background: #dcfce7; }
.option-btn.incorrect { border-color: var(--color-danger); background: #fee2e2; }

.shape { display: inline-block; width: 46px; height: 46px; margin: 4px; vertical-align: middle; }
.shape-circle { border-radius: 50%; background: var(--color-primary); }
.shape-square { background: var(--color-secondary); }
.shape-triangle { width: 0; height: 0; border-left: 23px solid transparent; border-right: 23px solid transparent; border-bottom: 40px solid var(--color-primary); background: none; }
.shape-star {
  background: var(--color-primary);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.shape-size-small { width: 24px; height: 24px; }
.shape-size-large { width: 68px; height: 68px; }
.shape-triangle.shape-size-small { border-left-width: 12px; border-right-width: 12px; border-bottom-width: 21px; }
.shape-triangle.shape-size-large { border-left-width: 34px; border-right-width: 34px; border-bottom-width: 59px; }
.quiz-chart-title { font-weight: 700; margin-bottom: 6px; }
.quiz-illustration {
  display: block;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  margin: 0 auto;
}

/* Badges / achievements */
.badge-item {
  text-align: center; padding: 24px 16px; background: var(--color-surface); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid rgba(15,23,42,.04); transition: transform .2s ease, box-shadow .2s ease;
}
.badge-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.badge-item .emoji {
  font-size: 42px; width: 84px; height: 84px; line-height: 84px; border-radius: 50%; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--color-secondary-light), var(--color-secondary));
  box-shadow: 0 8px 18px rgba(212,175,55,.35);
}
.badge-item.locked { opacity: .5; filter: grayscale(1); }
.badge-item.locked .emoji { background: #e5e9f3; box-shadow: none; }

/* Footer */
.site-footer { background: #10193a; color: rgba(255,255,255,.75); padding: 50px 0 20px;}
.site-footer h4 { color: #fff; margin-bottom: 14px; }
.site-footer a { color: rgba(255,255,255,.7); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 30px; padding-top: 20px; text-align: center; font-size: 13px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; } }

.a2hs-banner {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--color-primary); color: #fff;
  padding: 18px 20px 16px; display: none; flex-direction: column; align-items: center; gap: 12px;
  text-align: center; z-index: 2000; box-shadow: 0 -4px 16px rgba(0,0,0,.2);
}
.a2hs-banner.show { display: flex; }
.a2hs-banner span { max-width: 480px; font-size: 14px; }
.a2hs-banner-close {
  position: absolute; top: 10px; right: 14px; background: none; border: none; color: #fff;
  font-size: 16px; line-height: 1; cursor: pointer; padding: 6px; opacity: .8;
}
.a2hs-banner-close:hover { opacity: 1; }
#a2hsInstallBtn { min-width: 200px; }

.profile-layout { display: grid; grid-template-columns: 1.3fr .7fr; gap: 24px; align-items: start; }
.profile-layout > div { min-width: 0; }
@media (max-width: 900px) { .profile-layout { grid-template-columns: 1fr; } }

.mt-0{margin-top:0} .mb-0{margin-bottom:0} .text-center{text-align:center} .text-muted{color:var(--color-text-muted)}
.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.flex{display:flex}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-1{gap:8px}.gap-2{gap:16px}

/* Credits shown inside the username dropdown (replaces the old topbar diamond badge) */
.user-menu-credits {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px;
  background: var(--color-bg); font-weight: 700; font-size: 14px; color: var(--color-text); margin-bottom: 4px;
}
.user-menu-credits .emoji { font-size: 16px; }

/* Full-screen overlay shown while a quiz is being generated by the AI */
.quiz-loading-overlay {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.7); z-index: 3000;
  align-items: center; justify-content: center; text-align: center; padding: 20px;
}
.quiz-loading-overlay.show { display: flex; }
.quiz-loading-box { background: #fff; border-radius: var(--radius); padding: 34px 30px; max-width: 340px; box-shadow: var(--shadow-lg); }
.quiz-loading-spinner {
  width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 50%; border: 5px solid #e5e9f3;
  border-top-color: var(--color-primary); animation: quiz-spin 0.9s linear infinite;
}
@keyframes quiz-spin { to { transform: rotate(360deg); } }
.quiz-loading-box h3 { margin: 0 0 8px; font-size: 17px; }
.quiz-loading-box p { margin: 0; color: var(--color-text-muted); font-size: 14px; }

/* Custom (admin-added) skill cards on the progress page - visually distinct from the built-in skills card */
.custom-skill-card {
  background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px dashed var(--color-secondary); padding: 20px;
}
.custom-skill-card .skill-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.custom-skill-card .skill-card-title { font-weight: 700; font-size: 15px; }
.custom-skill-card .skill-card-value { font-weight: 800; color: var(--color-primary); }

.badge-soon {
  display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  background: var(--color-secondary); color: #1a1a1a; padding: 3px 8px; border-radius: 999px; margin-left: 6px;
  vertical-align: middle;
}

/* School Syllabus cascading fields on the quiz generation form */
.syllabus-field select { background: var(--color-bg); }
.other-skill-field input { background: var(--color-bg); }

/* Force the "Generate Quiz" button to always render last on mobile, regardless of which
   conditional fields (syllabus/other) are currently shown before it in source order. */
@media (max-width: 900px) {
  #generateQuizForm .generate-btn-field { order: 99; }
}

/* Real-time percentage progress bar inside the quiz generation loading overlay */
.quiz-loading-progress { margin-top: 18px; display: flex; align-items: center; gap: 10px; }
.quiz-loading-progress .progress-bar { flex: 1; }
.quiz-loading-progress-text { font-weight: 800; font-size: 13px; color: var(--color-primary); min-width: 36px; text-align: right; }

/* -------------------- Cambridge English level card (progress.php) -------------------- */
.cambridge-card { border: 1px solid rgba(30,58,138,.12); }
.cambridge-current { font-size: 22px; font-weight: 800; color: var(--color-primary); margin: 4px 0 6px; }
.cambridge-estimate-tag { font-size: 12px; font-weight: 700; color: var(--color-text-muted); background: var(--color-bg); padding: 3px 8px; border-radius: 999px; vertical-align: middle; }
.cambridge-path { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.cambridge-step {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--color-bg); border: 1px solid rgba(15,23,42,.08); font-size: 13px; font-weight: 600;
  color: var(--color-text-muted);
}
.cambridge-step-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(15,23,42,.2); flex-shrink: 0; }
.cambridge-step.done { background: rgba(212,175,55,.14); border-color: rgba(212,175,55,.3); color: var(--color-text); }
.cambridge-step.done .cambridge-step-dot { background: var(--color-secondary); }
.cambridge-step.current { background: var(--color-primary); border-color: var(--color-primary); color: #fff; box-shadow: var(--shadow); }
.cambridge-step.current .cambridge-step-dot { background: #fff; }
@media (max-width: 600px) { .cambridge-path { gap: 8px; } .cambridge-step { padding: 7px 11px; font-size: 12px; } }

.skill-progress-meta { margin-top: 4px; }

/* -------------------- Add to Home Screen instructional modal -------------------- */
.a2hs-modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.7); z-index: 3000;
  align-items: center; justify-content: center; text-align: center; padding: 20px;
}
.a2hs-modal-overlay.show { display: flex; }
.a2hs-modal { background: #fff; border-radius: var(--radius); padding: 30px 28px; max-width: 360px; box-shadow: var(--shadow-lg); }
.a2hs-modal h3 { margin: 0 0 12px; font-size: 18px; }
.a2hs-modal p { margin: 0 0 20px; color: var(--color-text-muted); font-size: 14px; line-height: 1.5; }

/* -------------------- Testimonials (index.php, below pricing) -------------------- */
.testimonials-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 30px; }
@media (max-width: 900px) { .testimonials-grid { grid-template-columns: 1fr; } }
.testimonial-card { display: flex; flex-direction: column; gap: 12px; }
.testimonial-stars { color: var(--color-secondary); font-size: 15px; letter-spacing: 2px; }
.testimonial-quote { font-size: 14.5px; line-height: 1.6; color: var(--color-text); font-style: italic; flex: 1; }
.testimonial-author { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.testimonial-avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; flex-shrink: 0;
}
.testimonial-author-name { font-weight: 700; font-size: 13.5px; }
.testimonial-author-role { font-size: 12px; color: var(--color-text-muted); }

/* -------------------- Split-screen auth pages (login/register) -------------------- */
.auth-page {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #fff;
}
.auth-page .auth-form-col {
  display: flex; flex-direction: column; justify-content: center; padding: 40px 60px; position: relative;
}
.auth-page .auth-topbar {
  position: absolute; top: 28px; left: 60px; right: 60px; display: flex; align-items: center; justify-content: space-between;
}
.auth-page .auth-topbar .brand { color: var(--color-primary); font-weight: 800; font-size: 19px; display: flex; align-items: center; gap: 8px; }
.auth-page .auth-topbar .brand img { height: 32px; width: auto; border-radius: 6px; }
.auth-page .auth-switch-note { font-size: 14px; color: var(--color-text-muted); }
.auth-page .auth-switch-note a { font-weight: 700; }
.auth-page .auth-form-inner { max-width: 380px; width: 100%; margin: 0 auto; }
.auth-page .auth-form-inner h2 { font-size: 27px; margin: 0 0 8px; }
.auth-page .auth-form-inner .auth-subtitle { color: var(--color-text-muted); margin: 0 0 28px; font-size: 15px; }
.auth-page .auth-visual-col {
  background: linear-gradient(160deg, #eaf0fb 0%, #dfe8fb 60%, #e9f3ea 100%);
  display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; padding: 60px;
}
.auth-page .auth-visual-col::before, .auth-page .auth-visual-col::after {
  content: ''; position: absolute; border-radius: 50%;
}
.auth-page .auth-visual-col::before { width: 260px; height: 260px; background: rgba(212,175,55,.18); top: -60px; right: -60px; }
.auth-page .auth-visual-col::after { width: 200px; height: 200px; background: rgba(30,58,138,.10); bottom: -50px; left: -40px; }
.auth-visual-content { position: relative; z-index: 2; text-align: center; max-width: 380px; }
.auth-visual-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 26px; text-align: left; margin-bottom: 22px;
}
.auth-visual-card .auth-visual-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f1f3f8; }
.auth-visual-card .auth-visual-row:last-child { border-bottom: none; }
.auth-visual-card .auth-visual-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--color-primary); color: #fff; display: flex;
  align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.auth-visual-card .auth-visual-text strong { display: block; font-size: 13.5px; }
.auth-visual-card .auth-visual-text small { color: var(--color-text-muted); font-size: 12px; }
.auth-visual-content h3 { color: var(--color-primary); font-size: 21px; margin: 0 0 6px; }
.auth-visual-content p { color: var(--color-text-muted); font-size: 14.5px; }
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-page .auth-visual-col { display: none; }
  .auth-page .auth-form-col { padding: 24px 24px 40px; }
  .auth-page .auth-topbar {
    position: static; left: auto; right: auto; margin-bottom: 30px;
    flex-direction: column; align-items: flex-start; gap: 10px;
  }
  .auth-page .auth-switch-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
}

/* Twemoji images (assets/js/emoji.js) */
.emoji-img { height: 1.15em; width: 1.15em; vertical-align: -0.2em; display: inline-block; margin: 0 .05em; }
