/* =========================
   DESIGN SYSTEM (MASTER)
========================= */

:root {
  /* Core brand */
  --emerald: #064e3b;
  --emerald-2: #0b7a5e;
  --emerald-3: #06634c;

  /* Neutrals */
  --paper: rgba(255,255,255,.92);
  --ink: #0f1a16;
  --muted: #356a59;

  /* Background */
  --bg: #053a2d;
  --overlay: rgba(255,255,255,.45);

  /* Accent */
  --gold: #ffcf55;
  --amber: #ffae24;
  --mint: #cfe6df;
  --soft: #dfe8dc;

  /* UI */
  --ring: rgba(6,78,59,.18);
  --shadow: 0 20px 50px rgba(0,0,0,.12);
  --radius: 18px;

  /* Typography */
  --font: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

/* =========================
   BASE RESET
========================= */

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
}

/* Background image system (single unified version) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("../images/homeschoolbackground.png") center/cover no-repeat;
  filter: brightness(.9) saturate(1.05);
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(
    80% 60% at 50% 20%,
    rgba(255,255,255,.55),
    rgba(255,255,255,.30) 60%,
    rgba(255,255,255,.10)
  );
  z-index: -1;
}

/* =========================
   LAYOUT SYSTEM
========================= */

.page {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.wrap, .shell {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px;
}

/* =========================
   CARD SYSTEM
========================= */

.card, .panel {
  background: var(--paper);
  backdrop-filter: blur(6px);
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(6,78,59,.12);
  padding: 28px;
}

/* =========================
   TYPOGRAPHY
========================= */

h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 2.4vw + 18px, 46px);
  color: var(--emerald);
  font-weight: 900;
}

h2 {
  color: var(--emerald);
}

h3 {
  color: var(--emerald-2);
}

p, .sub, .lead {
  color: var(--muted);
}

/* =========================
   BUTTON SYSTEM
========================= */

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  border-radius: 14px;
  font-weight: 900;
  padding: 14px 18px;
  transition: .15s ease;
}

.btn-primary {
  background: linear-gradient(180deg, var(--emerald-2), var(--emerald-3));
  color: white;
  box-shadow: 0 12px 28px rgba(6,99,76,.35);
}

.btn-secondary {
  background: #fff;
  border: 2px solid var(--mint);
  color: var(--emerald);
}

.btn:hover {
  transform: translateY(-1px);
}
.btn-emerald {
      background:linear-gradient(180deg, #0b7a5e, #06634c); color:#fff;
      box-shadow:0 12px 28px rgba(6,99,76,.35);
    }
    .btn-emerald:hover { filter:brightness(1.05) }
    .btn-emerald:active { transform:translateY(1px) }
    .btn-ghost {
      background:#fff; color:var(--emerald); border:2px solid #cfe6df;
    }

/* =========================
   CHIPS / TAGS SYSTEM
========================= */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin: 14px 0;
}

.chip {
  background: linear-gradient(180deg, var(--gold), #f6d94f);
  color: #5a4b00;
  border: 2px solid #f3cf3a;
  border-radius: 18px;
  padding: 12px 16px;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(90,75,0,.18);
  opacity: 1;
  transform: translateY(0);
  position: relative;
}
.chip.enter {
  animation: chipIn .48s cubic-bezier(.22,.9,.35,1) both;
}

.chip.exit {
  animation: chipOut .22s ease both;
}
.chip .x{
      position:absolute; top:8px; right:8px;
      width:36px; height:36px; border-radius:12px;
      display:grid; place-items:center;
      border:2px solid rgba(0,0,0,.07);
      background:#fff5bf;
      color:#8a1d1d; font-size:20px; font-weight:900;
      cursor:pointer;
      transition: transform .06s ease, filter .15s ease;
    }
    .chip .x:hover{ filter:brightness(1.05) }
    .chip .x:active{ transform: translateY(1px) }


@keyframes chipIn {
  0% { opacity: 0; transform: translateY(14px) scale(.96); }
  70% { opacity: 1; transform: translateY(-4px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes chipOut {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(10px) scale(.96); }
}
/* =========================
   FORMS
========================= */

input, select, textarea {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 2px solid var(--mint);
  font-size: 16px;
}

textarea {
  min-height: 120px;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  box-shadow: 0 0 0 6px var(--ring);
  border-color: var(--emerald-2);
}

/* =========================
   UNIT / LESSON SYSTEM
========================= */
 .logo{ display:block; margin:0 auto 10px; max-width:260px; height:auto; filter: drop-shadow(0 2px 3px rgba(0,0,0,.06)); }


.units {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 800px) {
  .units {
    grid-template-columns: 1fr;
  }
}

.unit-card {
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--mint);
  box-shadow: 0 12px 24px rgba(6,78,59,.08);
}

/* =========================
   DEMO + LOCKED STATES
========================= */

.demo-card {
  background: linear-gradient(180deg, #fff7d6, #fff);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 12px;
}

.locked-card {
  opacity: .5;
  filter: grayscale(.3);
}

/* =========================
   LOADER
========================= */

.loader1 {
  display: none;
  position: fixed;
  inset: 0;
  margin: auto;
  width: 120px;
  aspect-ratio: 1;
  z-index: 1000;

  --g: radial-gradient(farthest-side, #0000 70%, var(--emerald) 85%, #0000 100%);
  background: var(--g), var(--g), var(--g);
  background-size: 60px 60px;
  animation: spin 1.5s infinite;
}

@keyframes spin {
  0% { background-position: 0 0, 0 100%, 100% 100%; }
  50% { background-position: 100% 0, 0 0, 100% 100%; }
  100% { background-position: 100% 100%, 0 0, 0 100%; }
}

/* =========================
   SMALL UTILITIES
========================= */

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.note {
  font-size: 13px;
  color: var(--muted);
}