/* Learngrid.academy · Design System (Emerald + Charcoal · LearnYard-inspired) */
:root {
  /* ---- Palette ---- */
  --ink:            #0B1220;    /* Primary text on light bg */
  --ink-2:          #1F2937;
  --ink-3:          #4B5563;
  --ink-muted:      #6B7280;
  --line:           #E5E7EB;
  --line-2:         #F3F4F6;
  --bg:             #FFFFFF;
  --bg-2:           #FAFBFC;
  --bg-3:           #F5F7FA;

  --brand:          #059669;    /* Emerald 600 */
  --brand-2:        #047857;    /* Emerald 700 */
  --brand-3:        #10B981;    /* Emerald 500 */
  --brand-soft:     rgba(5, 150, 105, 0.08);
  --brand-ring:     rgba(5, 150, 105, 0.20);

  --charcoal:       #111827;    /* Charcoal for dark accents */
  --charcoal-2:     #0B0F17;

  --danger:         #DC2626;
  --warn:           #D97706;
  --info:           #2563EB;
  --ok:             #059669;

  /* ---- Radii ---- */
  --r-sm:  6px; --r:  10px; --r-lg: 14px; --r-xl: 20px; --r-2xl: 28px;

  /* ---- Elevation ---- */
  --sh-1: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --sh-2: 0 4px 6px -1px rgba(16,24,40,.06), 0 2px 4px -1px rgba(16,24,40,.04);
  --sh-3: 0 12px 24px -8px rgba(16,24,40,.10), 0 6px 12px -4px rgba(16,24,40,.06);
  --sh-brand: 0 8px 24px -8px rgba(5,150,105,.35);

  /* ---- Typography ---- */
  --f-sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --f-display:'Manrope', 'Inter', sans-serif;
  --f-mono:   'JetBrains Mono', ui-monospace, monospace;

  --container: 1180px;
}

/* ============ Reset + base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--f-sans); font-size: 16px; line-height: 1.6; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-2); }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1,h2,h3,h4,h5 { margin: 0 0 .5em; letter-spacing: -0.02em; color: var(--ink); font-family: var(--f-display); font-weight: 700; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); line-height: 1.1; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.15; }
h3 { font-size: 1.35rem; line-height: 1.3; }
p  { margin: 0 0 1em; color: var(--ink-2); }
::selection { background: var(--brand-soft); color: var(--brand-2); }

/* ============ Layout primitives ============ */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section   { padding: clamp(3rem, 7vw, 6rem) 0; }
.section-tight { padding: 3rem 0; }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.flex { display: flex; }
.flex-c { display: flex; align-items: center; }
.gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; } .gap-6 { gap: 1.5rem; }
.mt-2 { margin-top: .5rem; } .mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; } .mt-12 { margin-top: 3rem; }
.mb-2 { margin-bottom: .5rem; } .mb-4 { margin-bottom: 1rem; } .mb-6 { margin-bottom: 1.5rem; } .mb-8 { margin-bottom: 2rem; }
.text-center { text-align: center; } .text-right { text-align: right; }
.text-xs { font-size: .75rem; } .text-sm { font-size: .875rem; } .text-lg { font-size: 1.125rem; } .text-xl { font-size: 1.25rem; } .text-2xl { font-size: 1.5rem; }
.muted { color: var(--ink-muted); } .brand { color: var(--brand); }
.hidden { display: none; } .block { display: block; } .w-full { width: 100%; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.15rem; border-radius: var(--r); border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; transition: all .15s; cursor: pointer; text-decoration: none;
  white-space: nowrap;
}
.btn-primary   { background: var(--brand); color: #fff; box-shadow: var(--sh-brand); }
.btn-primary:hover { background: var(--brand-2); transform: translateY(-1px); box-shadow: 0 12px 30px -8px rgba(5,150,105,.4); color:#fff; }
.btn-ghost     { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-3); border-color: var(--ink-muted); color: var(--ink); }
.btn-outline   { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn-outline:hover { background: var(--brand-soft); color: var(--brand-2); }
.btn-dark      { background: var(--charcoal); color: #fff; }
.btn-dark:hover{ background: #000; color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-sm { padding: .5rem .85rem; font-size: .85rem; }
.btn-lg { padding: .95rem 1.5rem; font-size: 1rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============ Forms ============ */
.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.label { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.input, .textarea, .select {
  width: 100%; padding: .7rem .9rem; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); transition: all .15s; font-size: .95rem;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring);
}
.textarea { min-height: 120px; resize: vertical; }
.help { font-size: .8rem; color: var(--ink-muted); }
.error { font-size: .82rem; color: var(--danger); }

/* ============ Cards ============ */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-1); transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--sh-2); }
.card-body { padding: 1.5rem; }
.card-lift { cursor: pointer; }
.card-lift:hover { transform: translateY(-2px); box-shadow: var(--sh-3); }

/* ============ Alerts ============ */
.alert { padding: .85rem 1rem; border-radius: var(--r); border-left: 3px solid; font-size: .92rem; margin: .5rem 0; }
.alert-ok    { background: #ECFDF5; color: #065F46; border-color: var(--ok); }
.alert-warn  { background: #FFFBEB; color: #92400E; border-color: var(--warn); }
.alert-err   { background: #FEF2F2; color: #991B1B; border-color: var(--danger); }
.alert-info  { background: #EFF6FF; color: #1E40AF; border-color: var(--info); }

/* ============ Badges & Pills ============ */
.badge { display: inline-flex; align-items: center; padding: .2rem .6rem; border-radius: 99px;
         font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.badge-brand { background: var(--brand-soft); color: var(--brand-2); }
.badge-dark  { background: var(--charcoal); color: #fff; }
.badge-line  { background: transparent; color: var(--ink-3); border: 1px solid var(--line); }

/* ============ Nav / Header ============ */
.nav { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.85);
       backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand-wm { display: flex; align-items: center; gap: .55rem; font-family: var(--f-display); font-weight: 800; font-size: 1.15rem; color: var(--ink); letter-spacing: -.02em; }
.brand-dot { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .82rem; box-shadow: var(--sh-brand); }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a { color: var(--ink-2); font-weight: 500; font-size: .95rem; }
.nav-links a:hover, .nav-links a.active { color: var(--brand); }
.nav-cta { display: flex; align-items: center; gap: .6rem; }
.nav-mobile { display: none; background: none; border: none; padding: 8px; color: var(--ink); }

/* ============ Footer ============ */
.footer { background: var(--charcoal); color: #E5E7EB; padding: 4rem 0 1.5rem; margin-top: 5rem; }
.footer h5 { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 1rem; font-weight: 700; }
.footer a { color: #9CA3AF; font-size: .9rem; }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; padding-bottom: 3rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.footer-links { display: flex; flex-direction: column; gap: .55rem; }
.footer-bottom { padding-top: 1.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; color: #6B7280; font-size: .85rem; }
.pay-strip { display: flex; gap: .4rem; flex-wrap: wrap; }
.pay-chip { padding: .28rem .65rem; border: 1px solid rgba(255,255,255,.15); border-radius: 99px; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: #9CA3AF; }

/* ============ Hero ============ */
.hero { position: relative; overflow: hidden; padding: clamp(4rem, 10vw, 8rem) 0 clamp(4rem, 8vw, 6rem); }
.hero::before {
  content: ''; position: absolute; top: -30%; left: 50%; transform: translateX(-50%);
  width: 800px; height: 800px; background: radial-gradient(circle, var(--brand-soft) 0%, transparent 60%);
  z-index: -1; pointer-events: none;
}
.hero-eyebrow { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .8rem;
                background: var(--brand-soft); color: var(--brand-2); border-radius: 99px;
                font-size: .82rem; font-weight: 600; }
.hero h1 { max-width: 20ch; margin-bottom: 1.2rem; }
.hero-sub { font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--ink-3); max-width: 60ch; }
.hero-cta { display: flex; gap: .8rem; margin-top: 2rem; flex-wrap: wrap; }
.hero-metrics { display: flex; gap: 2.5rem; margin-top: 3rem; flex-wrap: wrap; }
.hero-metric-num { font-family: var(--f-display); font-size: 1.8rem; font-weight: 800; color: var(--ink); }
.hero-metric-lbl { font-size: .85rem; color: var(--ink-muted); }

/* ============ Feature blocks ============ */
.feature { padding: 1.5rem; }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 1rem; }
.feature h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.feature p { color: var(--ink-3); font-size: .93rem; }

/* ============ CTA banner ============ */
.cta-band {
  background: linear-gradient(135deg, var(--charcoal) 0%, var(--charcoal-2) 100%);
  color: #fff; padding: 4rem 2rem; border-radius: var(--r-2xl); text-align: center;
  position: relative; overflow: hidden;
}
.cta-band::before { content:''; position:absolute; inset:0; background: radial-gradient(circle at 30% 20%, rgba(5,150,105,.15) 0%, transparent 50%); pointer-events:none; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.75); max-width: 50ch; margin: 1rem auto 2rem; }

/* ============ Pricing card ============ */
.pricing-wrap { max-width: 480px; margin: 0 auto; }
.pricing-card {
  background: #fff; border: 2px solid var(--brand); border-radius: var(--r-2xl); padding: 2.5rem;
  box-shadow: var(--sh-brand); text-align: center; position: relative;
}
.pricing-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: #fff; padding: .3rem 1rem; border-radius: 99px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pricing-price { font-family: var(--f-display); font-size: 3.2rem; font-weight: 800; color: var(--ink); line-height: 1; }
.pricing-price .cur { font-size: 1.6rem; vertical-align: super; color: var(--ink-muted); font-weight: 600; }
.pricing-price-strike { text-decoration: line-through; color: var(--ink-muted); font-size: 1.1rem; font-weight: 500; }
.pricing-note { color: var(--ink-muted); font-size: .9rem; margin: 1rem 0 2rem; }
.pricing-features { list-style: none; padding: 0; margin: 0 0 2rem; text-align: left; display: flex; flex-direction: column; gap: .7rem; }
.pricing-features li { display: flex; gap: .55rem; align-items: flex-start; font-size: .95rem; color: var(--ink-2); }
.pricing-features li svg { color: var(--brand); flex-shrink: 0; margin-top: 3px; }

/* ============ Auth pages ============ */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-form-card { width: 100%; max-width: 420px; }
.auth-visual-side { background: linear-gradient(135deg, var(--charcoal) 0%, var(--charcoal-2) 100%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-visual-side::before { content:''; position:absolute; inset:0; background: radial-gradient(circle at 70% 30%, rgba(5,150,105,.2) 0%, transparent 50%); }
.auth-visual-side > * { position: relative; z-index: 1; }
.auth-visual-quote { font-family: var(--f-display); font-size: 1.4rem; line-height: 1.4; font-weight: 500; }

/* ============ Admin ============ */
.adm-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.adm-side { background: var(--charcoal); color: #E5E7EB; padding: 2rem 1rem; display: flex; flex-direction: column; }
.adm-side .brand-wm { color: #fff; padding: 0 .6rem 1.5rem; margin-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.adm-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.adm-nav a { color: #9CA3AF; padding: .6rem .8rem; border-radius: 8px; display: flex; align-items: center; gap: .7rem; font-size: .92rem; }
.adm-nav a:hover, .adm-nav a.active { background: rgba(255,255,255,.06); color: #fff; }
.adm-nav a svg { width: 18px; height: 18px; }
.adm-main { padding: 2rem 2.5rem; background: var(--bg-2); }
.adm-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.adm-header h1 { margin: 0; font-size: 1.5rem; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.kpi { padding: 1.25rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }
.kpi-label { font-size: .82rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi-value { font-family: var(--f-display); font-size: 2rem; font-weight: 700; margin-top: .25rem; }

/* ============ Tables ============ */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
.table th, .table td { padding: .85rem 1rem; text-align: left; font-size: .92rem; }
.table th { background: var(--bg-3); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; }
.table tr { border-bottom: 1px solid var(--line-2); }
.table tr:last-child { border-bottom: none; }

/* ============ Toasts / Flash ============ */
.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: .5rem; max-width: 380px; }
.toast { padding: .85rem 1.1rem; border-radius: var(--r); box-shadow: var(--sh-3); background: #fff; border-left: 3px solid var(--brand); font-size: .9rem; animation: toastIn .3s ease-out; }
.toast.err  { border-color: var(--danger); }
.toast.warn { border-color: var(--warn); }
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============ Legal doc ============ */
.legal-doc { max-width: 780px; margin: 0 auto; line-height: 1.8; color: var(--ink-2); font-size: .98rem; }
.legal-doc h2 { font-size: 1.4rem; margin: 2rem 0 .6rem; color: var(--ink); }
.legal-doc h2:first-child { margin-top: 0; }
.legal-doc ul, .legal-doc ol { padding-left: 1.5rem; }
.legal-doc li { margin: .5rem 0; }

/* ============ Utilities ============ */
.divider { height: 1px; background: var(--line); margin: 1.5rem 0; }
.chip-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-2); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .nav-links, .nav-cta { display: none; }
  .nav-mobile { display: block; }
  .nav-menu-open { display: flex; flex-direction: column; padding: 1rem 20px; gap: 1rem; background: #fff; border-top: 1px solid var(--line); }
  .nav-menu-open a { color: var(--ink-2); padding: .5rem 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual-side { display: none; }
  .adm-shell { grid-template-columns: 1fr; }
  .adm-side { display: none; }
  .adm-main { padding: 1.5rem; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 3rem 0; }
  .section { padding: 3rem 0; }
}
