/* ================================================================
   XopunXetu Public Website — Global Stylesheet
   ================================================================ */

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

/* ── CSS Variables (Design Tokens) ── */
:root {
  --primary: #000666;
  --primary-light: #3b44c4;
  --primary-dim: #bdc2ff;
  --primary-surface: #e0e0ff;
  --tertiary: #1d005e;
  --tertiary-light: #9d85fe;
  --surface: #fbf8ff;
  --surface-low: #f5f2fb;
  --surface-mid: #efecf5;
  --surface-high: #eae7ef;
  --surface-highest: #e4e1ea;
  --surface-dim: #dbd9e1;
  --on-surface: #1b1b21;
  --on-surface-var: #454652;
  --secondary: #5c5f60;
  --secondary-con: #e1e3e4;
  --outline: #767683;
  --outline-var: #c6c5d4;
  --inverse-surface: #303036;
  --inverse-on: #f2eff8;
  --error: #ba1a1a;
  --error-surface: #ffdad6;
  --success: #2e7d32;
  --success-surface: #e8f5e9;
  --gold: #f5a623;
  --teal: #00897b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .10), 0 2px 6px rgba(0, 0, 0, .07);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, .13), 0 4px 12px rgba(0, 0, 0, .09);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, .16), 0 8px 20px rgba(0, 0, 0, .10);

  --transition: all .2s ease;
  --transition-slow: all .4s ease;

  --max-width: 1920px;
  --nav-h: 72px;
  --mob-nav-h: 64px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--surface);
  color: var(--on-surface);
  line-height: 1.5;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input,
select,
textarea {
  font-family: inherit;
}

/* ── Typography ── */
h1,
h2,
h3,
h4,
h5 {
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: clamp(28px, 5vw, 48px);
}

h2 {
  font-size: clamp(22px, 3.5vw, 36px);
}

h3 {
  font-size: clamp(18px, 2.5vw, 24px);
}

h4 {
  font-size: 18px;
}

h5 {
  font-size: 16px;
}

/* ── Layout Utilities ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 48px;
  }
}

@media (min-width: 1280px) {
  .container {
    padding: 0 48px;
  }
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.gap-6 {
  gap: 24px;
}

.gap-8 {
  gap: 32px;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--on-surface-var);
}

.text-primary {
  color: var(--primary);
}

.text-sm {
  font-size: 14px;
  line-height: 1.5;
}

.text-xs {
  font-size: 12px;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 24px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: .01em;
  line-height: 1;
}

.btn:active {
  transform: scale(.97);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-surface);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
}

.btn-ghost:hover {
  background: var(--primary-surface);
}

.btn-surface {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--outline-var);
  box-shadow: var(--shadow-sm);
}

.btn-surface:hover {
  background: var(--surface-mid);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 15px 32px;
  font-size: 16px;
}

.btn-full {
  width: 100%;
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.badge-primary {
  background: var(--primary-surface);
  color: var(--primary);
}

.badge-green {
  background: var(--success-surface);
  color: var(--success);
}

.badge-gold {
  background: #fff3cd;
  color: #856404;
}

.badge-tertiary {
  background: #ede7ff;
  color: var(--tertiary);
}

.badge-free {
  background: var(--success-surface);
  color: var(--success);
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--outline-var);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.card-body {
  padding: 20px;
}

/* ── Form Controls ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface-var);
}

.form-control {
  padding: 12px 16px;
  border: 1.5px solid var(--outline-var);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: var(--surface);
  color: var(--on-surface);
  transition: var(--transition);
  outline: none;
  width: 100%;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 6, 102, .12);
}

.form-control::placeholder {
  color: var(--outline);
}

/* ── Skeleton loading ── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-high) 25%, var(--surface-highest) 50%, var(--surface-high) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--inverse-surface);
  color: var(--inverse-on);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 10000;
  max-width: 90vw;
  text-align: center;
  white-space: nowrap;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 768px) {
  #toast {
    bottom: 32px;
  }
}

/* ── Top Navigation Bar (Desktop) ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(251, 248, 255, .92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--outline-var);
  box-shadow: var(--shadow-sm);
}

.navbar .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
}

.nav-links {
  display: none;
  gap: 32px;
  align-items: center;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--on-surface-var);
  transition: var(--transition);
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width .2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

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

.nav-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary-surface);
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid var(--primary);
}

/* Mobile header */
.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--mob-nav-h);
  background: rgba(251, 248, 255, .95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--outline-var);
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.mobile-menu-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-var);
  transition: var(--transition);
}

.mobile-menu-btn:hover {
  background: var(--surface-mid);
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: -100%;
  width: 280px;
  background: var(--surface);
  z-index: 2000;
  box-shadow: var(--shadow-xl);
  transition: left .3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-drawer.open {
  left: 0;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-header {
  padding: 20px;
  border-bottom: 1px solid var(--outline-var);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-nav {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  color: var(--on-surface-var);
  transition: var(--transition);
}

.drawer-nav a:hover,
.drawer-nav a.active {
  background: var(--primary-surface);
  color: var(--primary);
}

.drawer-nav a span.material-symbols-outlined {
  font-size: 22px;
}

.drawer-footer {
  margin-top: auto;
  padding: 20px;
  border-top: 1px solid var(--outline-var);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Bottom Navigation (Mobile) ── */
.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--surface);
  border-top: 1px solid var(--outline-var);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
}

@media (min-width: 768px) {
  .bottom-nav {
    display: none;
  }
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: 600;
  color: var(--on-surface-var);
  transition: var(--transition);
  letter-spacing: .03em;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.active .bottom-nav-pill {
  background: var(--primary-surface);
}

.bottom-nav-pill {
  padding: 4px 20px;
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.bottom-nav-item span.material-symbols-outlined {
  font-size: 24px;
}

/* ── Hero Section ── */
.hero {
  background: linear-gradient(135deg, var(--primary-surface) 0%, var(--surface) 100%);
  position: relative;
  overflow: hidden;
  padding: 10px 0 52px;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(61, 68, 196, .12) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 6, 102, .08) 0%, transparent 70%);
  pointer-events: none;
}

@media (min-width: 768px) {
  .hero {
    padding: 40px 0 96px;
  }
}

/* ── Banner Carousel ── */
.banner-carousel {
  position: relative;
  width: 100%;
  height: 120px;
  overflow: hidden;
}

@media (min-width: 768px) {
  .banner-carousel {
    height: 380px;
  }
}

.banner-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .6s ease;
}

.banner-slide.active {
  opacity: 1;
}

.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0, 6, 102, .75) 0%, rgba(0, 6, 102, .2) 100%);
  display: flex;
  align-items: flex-end;
  padding: 24px;
}

@media (min-width: 768px) {
  .banner-overlay {
    padding: 40px 48px;
  }
}

.banner-text h2 {
  color: #fff;
  font-size: 20px;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}

@media (min-width: 768px) {
  .banner-text h2 {
    font-size: 28px;
  }
}

.banner-text p {
  color: rgba(255, 255, 255, .85);
  font-size: 14px;
}

.banner-text .btn {
  margin-top: 12px;
}

.banner-dots {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  gap: 6px;
}

.banner-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, .5);
  cursor: pointer;
  transition: var(--transition);
}

.banner-dot.active {
  background: #fff;
  width: 24px;
}

/* ── Section ── */
.section {
  padding: 56px 0;
}

.section-sm {
  padding: 32px 0;
}

@media (min-width: 768px) {
  .section {
    padding: 80px 0;
  }
}

.section-header {
  margin-bottom: 40px;
}

.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 10px;
  background: var(--primary-surface);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* ── Course Grid ── */
.course-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .course-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .course-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.course-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.course-thumb {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: var(--surface-high);
}

@media (min-width: 768px) {
  .course-thumb {
    height: 180px;
  }
}

.course-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.course-card:hover .course-thumb img {
  transform: scale(1.05);
}

.course-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: rgba(255, 255, 255, .7);
  font-size: 48px;
}

.course-rating {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(251, 248, 255, .95);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 3px;
}

.course-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.course-category {
  font-size: 11px;
  font-weight: 700;
  color: var(--tertiary);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 6px;
}

.course-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: 6px;
  line-height: 1.35;
}

/* ── White Footer (Injected via JS) ────────────────────────────────── */
.footer {
  background: #ffffff;
  padding: 56px 24px calc(48px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  position: relative;
  margin-top: 60px;
  border-top: 1px solid var(--outline-var);
}

body.auth-layout .footer {
  display: none !important;
}

.footer-inner {
  width: 100%;
  max-width: 1280px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
  gap: 32px;
}

.footer-logo img {
  height: 106px;
  width: auto;
  object-fit: contain;
  display: block;
  transition: opacity 0.3s ease;
}

.footer-logo img:hover {
  opacity: 0.75;
}

.footer-links {
  display: flex;
  gap: 32px;
  align-items: center;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--on-surface-var);
  font-size: 15px;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.footer-links a:hover {
  color: var(--on-surface);
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.footer-links a:hover::after {
  width: 100%;
}

.footer-socials {
  display: flex;
  gap: 16px;
  align-items: center;
}

.footer-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-var);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-high);
  border: 1px solid var(--outline-var);
  transition: all 0.3s ease;
}

.footer-socials a:hover {
  color: var(--primary);
  background: var(--primary-surface);
  transform: translateY(-3px);
  border-color: var(--primary-light);
}

.footer-socials svg {
  width: 18px;
  height: 18px;
}

.footer-bottom {
  display: flex !important;
  flex-direction: column !important;
  gap: 24px !important;
  width: 100% !important;
}

.footer-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--outline-var), transparent);
}

.footer-credits {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  font-size: 14px;
  color: var(--on-surface-var);
  width: 100%;
  gap: 16px;
  flex-wrap: wrap !important;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-credits {
    flex-direction: row !important;
    justify-content: space-between !important;
  }
}

.footer-credits>span {
  white-space: normal;
}

.footer-legal-links {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-legal-links a {
  color: var(--on-surface-var);
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 14px;
  white-space: nowrap;
}

.footer-legal-links a:hover {
  color: var(--primary);
}

.course-desc {
  font-size: 13px;
  color: var(--on-surface-var);
  margin-bottom: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--on-surface-var);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.course-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.course-meta .material-symbols-outlined {
  font-size: 14px;
}

.course-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--surface-highest);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.course-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--on-surface);
}

.course-price-original {
  font-size: 14px;
  color: var(--outline);
  text-decoration: line-through;
  margin-right: 4px;
}

/* ── Test Cards ── */
.test-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.test-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.test-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.test-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.test-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--on-surface-var);
}

.test-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.test-meta .material-symbols-outlined {
  font-size: 16px;
}

.test-desc {
  font-size: 13px;
  color: var(--on-surface-var);
  line-height: 1.5;
}

.test-footer {
  padding-top: 12px;
  border-top: 1px solid var(--surface-highest);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Feature cards ── */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  padding: 28px 24px;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 26px;
}

.feature-icon-primary {
  background: var(--primary-surface);
  color: var(--primary);
}

.feature-icon-tertiary {
  background: #ede7ff;
  color: var(--tertiary);
}

.feature-icon-secondary {
  background: var(--secondary-con);
  color: var(--secondary);
}

.feature-icon-green {
  background: var(--success-surface);
  color: var(--success);
}

.feature-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}

.feature-desc {
  font-size: 14px;
  color: var(--on-surface-var);
  line-height: 1.6;
}

/* ── Stats bar ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-item {
  text-align: center;
  padding: 24px 16px;
}

.stat-value {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -.03em;
}

.stat-label {
  font-size: 14px;
  color: var(--on-surface-var);
  font-weight: 500;
  margin-top: 4px;
}

/* ── Filter Chips ── */
.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.chip {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--outline-var);
  color: var(--on-surface-var);
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
  background: var(--surface);
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-surface);
}

.chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--on-surface-var);
}

.empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--on-surface);
}

.empty-state p {
  font-size: 15px;
  margin-bottom: 24px;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}

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

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(.97);
  transition: transform .25s;
  box-shadow: var(--shadow-xl);
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 24px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--outline-var);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-var);
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--surface-mid);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ── Auth pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-surface) 0%, var(--surface) 50%, #ede7ff 100%);
  padding: 24px;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 40px 36px;
  width: 100%;
  max-width: 440px;
  border: 1px solid var(--outline-var);
}

@media (max-width: 480px) {
  .auth-card {
    padding: 28px 20px;
  }
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 20px;
}

.auth-logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}

.auth-card h1 {
  font-size: 26px;
  margin-bottom: 8px;
}

.auth-card .subtitle {
  color: var(--on-surface-var);
  font-size: 15px;
  margin-bottom: 28px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--outline);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--outline-var);
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--outline-var);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  background: var(--surface);
  cursor: pointer;
  transition: var(--transition);
}

.google-btn:hover {
  background: var(--surface-low);
  box-shadow: var(--shadow-sm);
}

.google-btn img {
  width: 20px;
  height: 20px;
}

/* ── Dashboard ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 280px 1fr;
  }
}

@media (min-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 300px 1fr;
  }
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: var(--surface-high);
  stroke-width: 8;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset .8s ease;
}

/* ── Footer ── */
footer {
  background: var(--inverse-surface);
  color: var(--inverse-on);
  padding: 64px 0 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer-brand .logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-dim);
  letter-spacing: -.02em;
  margin-bottom: 12px;
}

.footer-desc {
  font-size: 14px;
  color: rgba(242, 239, 248, .65);
  line-height: 1.7;
  margin-bottom: 20px;
}

.footer-social {
  display: flex;
  gap: 10px;
}

.social-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, .1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 18px;
}

.social-btn:hover {
  background: rgba(255, 255, 255, .2);
  transform: translateY(-2px);
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--inverse-on);
  margin-bottom: 16px;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col ul li a {
  font-size: 14px;
  color: rgba(242, 239, 248, .65);
  transition: var(--transition);
}

.footer-col ul li a:hover {
  color: var(--inverse-on);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  font-size: 13px;
  color: rgba(242, 239, 248, .45);
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ── Loader ── */
.loader-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.loader-dots span {
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: var(--radius-full);
  animation: bounce .8s ease infinite;
}

.loader-dots span:nth-child(2) {
  animation-delay: .15s;
}

.loader-dots span:nth-child(3) {
  animation-delay: .3s;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* ── Page loader overlay ── */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--surface);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity .4s;
}

.page-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ── Scroll to top ── */
.scroll-top {
  position: fixed;
  bottom: 88px;
  right: 20px;
  z-index: 900;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  cursor: pointer;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  .scroll-top {
    bottom: 40px;
  }
}

/* ── Search bar ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--outline-var);
  border-radius: var(--radius-full);
  padding: 10px 20px;
  transition: var(--transition);
  cursor: text;
}

.search-bar:focus-within,
.search-bar:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 6, 102, .10);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--on-surface);
}

.search-bar .material-symbols-outlined {
  color: var(--outline);
  font-size: 20px;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--surface-highest);
  margin-bottom: 28px;
}

.tab-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--on-surface-var);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ── Utility ── */
.mt-auto {
  margin-top: auto;
}

.w-full {
  width: 100%;
}

.pb-safe {
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.overflow-hidden {
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* %% Authenticated Master Layout %% */
.auth-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--outline-var);
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.auth-sidebar .sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--surface-high);
}

.auth-sidebar .sidebar-nav {
  flex: 1;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.auth-sidebar .sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--on-surface-var);
  font-weight: 500;
  transition: var(--transition);
}

.auth-sidebar .sidebar-nav a:hover {
  background: var(--surface-low);
  color: var(--on-surface);
}

.auth-sidebar .sidebar-nav a.active {
  background: var(--primary-surface);
  color: var(--primary);
  font-weight: 700;
}

.auth-sidebar .sidebar-footer {
  padding: 24px;
  border-top: 1px solid var(--surface-high);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

body.auth-layout {
  padding-left: 260px;
}

@media (max-width: 1023px) {
  .navbar {
    display: none !important;
  }
  .auth-sidebar {
    display: none !important;
  }
  body.auth-layout {
    padding-left: 0;
    padding-bottom: 80px;
  }
}


.horizontal-scroll {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: 24px;
  scroll-snap-type: x mandatory;
}
.horizontal-scroll > .card {
  flex: 0 0 300px;
  scroll-snap-align: start;
}
.horizontal-scroll::-webkit-scrollbar {
  height: 8px;
}
.horizontal-scroll::-webkit-scrollbar-track {
  background: var(--surface-high);
  border-radius: 4px;
}
.horizontal-scroll::-webkit-scrollbar-thumb {
  background: var(--outline-var);
  border-radius: 4px;
}
.horizontal-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--outline);
}
.welcome-banner {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  padding: 40px;
  border-radius: var(--radius-xl);
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}


/* ── Accordion UI ── */
.accordion-item { border-bottom: 1px solid var(--surface-high); }
.accordion-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; cursor: pointer; transition: background 0.2s; }
.accordion-header:hover { background: var(--surface-low); }
.accordion-title-row { display: flex; align-items: center; gap: 12px; }
.accordion-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--surface-highest); color: var(--on-surface-var); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.accordion-chevron { transition: transform 0.3s ease; color: var(--outline); }
.accordion-item.expanded .accordion-chevron { transform: rotate(180deg); }
.accordion-body { display: none; padding: 0 0 16px 52px; }
.accordion-item.expanded .accordion-body { display: block; animation: slideDown 0.3s ease; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
. s p i n  
   a n i m a t i o n :   s p i n   1 s   l i n e a r   i n f i n i t e ;    
 s p i n  
   1 0 0 %   {   t r a n s f o r m :   r o t a t e ( 3 6 0 d e g ) ;   }    
 