/* =========================================================
   ELISA ACADEMY — Design System
   Signature idea: notes cards read like exam-paper index cards —
   a folded top-right corner + a circular "marks stamp" price badge,
   tying the UI back to the actual product (exam notes).
   ========================================================= */

:root {
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --secondary: #7C3AED;
  --accent: #06B6D4;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --text: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --success: #16A34A;
  --danger: #DC2626;
  --warning: #D97706;

  --font-display: 'Sora', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 20px rgba(79, 70, 229, 0.08);
  --shadow-lg: 0 12px 40px rgba(79, 70, 229, 0.14);
  --container: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  padding: 12px 24px; border-radius: 999px; border: none; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: #EEF2FF; }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: rgba(15,23,42,0.05); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-danger { background: #FEE2E2; color: var(--danger); }
.btn-block { width: 100%; }

/* ---------- NAVBAR ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(248, 250, 252, 0.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem;
}
.nav-links { display: flex; align-items: center; gap: 28px; font-weight: 500; }
.nav-links a { color: var(--text-muted); transition: color 0.15s; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-links { position: fixed; top: 72px; left: 0; right: 0; background: #fff; flex-direction: column;
    padding: 20px 24px; border-bottom: 1px solid var(--border); display: none; gap: 16px; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; background: none; border: none; font-size: 1.4rem; cursor: pointer; }
}

/* ---------- HERO ---------- */
.hero { padding: 88px 0 64px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -180px; right: -140px; width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(79,70,229,0.16), transparent 70%); border-radius: 50%;
}
.hero::after {
  content: ""; position: absolute; bottom: -220px; left: -160px; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(6,182,212,0.14), transparent 70%); border-radius: 50%;
}
.hero-inner { position: relative; z-index: 1; max-width: 760px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; background: #EEF2FF; color: var(--primary);
  font-weight: 600; font-size: 0.8rem; padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 20px; }
.hero h1 .accent-word { background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.15rem; color: var(--text-muted); margin-bottom: 32px; max-width: 560px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- SECTION ---------- */
.section { padding: 64px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 36px; flex-wrap: wrap; gap: 16px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-head p { color: var(--text-muted); margin-top: 8px; }

/* ---------- FILTER PILLS ---------- */
.pill-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 32px; }
.pill {
  padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--border); background: #fff;
  font-weight: 600; font-size: 0.88rem; cursor: pointer; color: var(--text-muted); transition: all 0.15s;
}
.pill.active, .pill:hover { border-color: var(--primary); color: var(--primary); background: #EEF2FF; }

/* ---------- NOTE CARD (signature component) ---------- */
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }

.note-card {
  position: relative; background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden; transition: transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.note-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* folded corner motif — like a real index card */
.note-card::after {
  content: ""; position: absolute; top: 0; right: 0; width: 26px; height: 26px;
  background: linear-gradient(135deg, transparent 50%, var(--bg) 51%);
  border-left: 1px solid var(--border); border-bottom: 1px solid var(--border);
  z-index: 2;
}

.note-cover { position: relative; aspect-ratio: 4/3; background: linear-gradient(135deg, #EEF2FF, #ECFEFF); overflow: hidden; }
.note-cover img { width: 100%; height: 100%; object-fit: cover; }
.note-subject-tag {
  position: absolute; top: 12px; left: 12px; background: rgba(15,23,42,0.75); color: #fff;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px;
}
.note-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.note-chapter { font-size: 0.75rem; color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.note-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; }
.note-meta { display: flex; align-items: center; gap: 12px; font-size: 0.82rem; color: var(--text-muted); }
.note-rating { display: flex; align-items: center; gap: 4px; color: var(--warning); font-weight: 700; }
.note-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; }

/* the "marks stamp" price badge — circular, like a score written on an exam paper */
.price-stamp {
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  width: 54px; height: 54px; border-radius: 50%; border: 2px dashed var(--primary);
  color: var(--primary); font-family: var(--font-display); font-weight: 800; font-size: 0.95rem;
  transform: rotate(-6deg);
}
.price-row { display: flex; align-items: baseline; gap: 8px; }
.price-original { text-decoration: line-through; color: var(--text-muted); font-size: 0.85rem; }
.price-current { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--primary); }

.note-actions { display: flex; gap: 8px; padding: 0 18px 18px; }

/* ---------- CARDS (generic) ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.feature-card { text-align: left; }
.feature-icon {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-size: 1.2rem; margin-bottom: 16px;
}
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .grid-4 { grid-template-columns: 1fr; } }

/* ---------- CLASS TILES ---------- */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.class-tile { padding: 22px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; text-align: center; }
.class-tile.active { border-color: var(--primary); background: linear-gradient(160deg, #EEF2FF, #fff); }
.class-tile .num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.class-tile .lbl { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }
.badge-soon { display: inline-block; margin-top: 8px; font-size: 0.68rem; font-weight: 700; color: var(--text-muted); background: var(--bg); padding: 3px 8px; border-radius: 999px; }

/* ---------- FOOTER ---------- */
footer { background: #0F172A; color: #CBD5E1; padding: 56px 0 28px; margin-top: 80px; }
footer h4 { color: #fff; margin-bottom: 14px; font-size: 1rem; }
footer a { color: #94A3B8; }
footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.footer-grid li { margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid #1E293B; padding-top: 22px; font-size: 0.85rem; color: #64748B; text-align: center; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- FORMS ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.95rem; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.12); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

/* ---------- UTILITIES ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; }
.badge-success { background: #DCFCE7; color: #15803D; }
.badge-warning { background: #FEF3C7; color: #B45309; }
.badge-muted { background: var(--bg); color: var(--text-muted); }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(79,70,229,0.2); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* ---------- TOAST ---------- */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--text); color: #fff;
  padding: 14px 22px; border-radius: 999px; font-weight: 600; font-size: 0.9rem; z-index: 200; transition: transform 0.25s ease; box-shadow: var(--shadow-lg); }
#toast.show { transform: translateX(-50%) translateY(0); }
