@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { min-height: 100%; }

:root {
  --bg:         #0B3A4D;
  --lime:       #8FCC28;
  --lime-dark:  #6fa01e;
  --teal:       #1D8AAD;
  --teal-text:  #5FB8D6;
  --purple:     #1D8AAD;
  --purple-dim: rgba(123,94,167,0.2);
  --coral:      #6FA01E;  /* deprecated → brand lime-dark */
  --amber:      #F0B429;  /* brand amber */
  --sky:        #5FB8D6;  /* deprecated → brand teal-text */
  --white:      rgba(255,255,255,0.90);
  --white-dim:  rgba(255,255,255,0.62);
  --white-faint:rgba(255,255,255,0.07);
  --border:     rgba(255,255,255,0.13);
  --font:       'Outfit', sans-serif;
  --radius:     20px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.num, .stat-value, .score, .price, .streak-num, .xp-total { font-variant-numeric: tabular-nums; }

/* ── Background ── */
.bg-layer {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, #1D6E8C 0%, transparent 60%),
    radial-gradient(ellipse 60% 70% at 20% 80%, #124D63 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 90% 90%, #0D5573 0%, transparent 50%),
    linear-gradient(160deg, #0B3A4D 0%, #1A6880 50%, #0E4A61 100%);
}

/* ── Watermark ── */
.watermark {
  position: fixed; width: 60vmin; height: 60vmin;
  object-fit: contain; opacity: 0.06;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  z-index: 1; pointer-events: none;
}

/* ── Page wrapper ── */
.page-wrap {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  align-items: center; width: 100%;
  min-height: 100vh;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ── Wordmark ── */
.wordmark {
  text-align: center;
  padding-top: 64px; padding-bottom: 44px;
}
.wordmark-top {
  display: block; font-size: clamp(32px, 5vw, 64px);
  font-weight: 600; letter-spacing: 0.22em; color: #fff; line-height: 1;
}
.wordmark-sub {
  display: block; font-size: clamp(12px, 1.6vw, 20px);
  font-weight: 300; letter-spacing: 0.45em; color: var(--lime); margin-top: 8px;
}
.wordmark-rule {
  width: 40px; height: 2px; background: var(--lime);
  margin: 14px auto 0; border-radius: 99px; opacity: 0.85;
}

/* ── Logo watermark (full page background) ── */
.watermark {
  position: fixed; width: 55vmin; height: 55vmin;
  object-fit: contain; opacity: 0.045;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  z-index: 1; pointer-events: none;
}

/* ── Page header (sub-pages) ── */
.page-header {
  text-align: center;
  padding-top: 48px; padding-bottom: 36px;
}
.page-header-title {
  display: block; font-size: clamp(22px, 3.5vw, 42px);
  font-weight: 600; letter-spacing: 0.14em; color: #fff;
}
.page-header-sub {
  display: block; font-size: 12px; font-weight: 300;
  letter-spacing: 0.2em; color: var(--lime); margin-top: 6px;
}
.page-header-rule {
  width: 40px; height: 2px; background: var(--lime);
  margin: 12px auto 0; border-radius: 99px; opacity: 0.7;
}

/* ── Back button ── */
.back-btn {
  align-self: flex-start; margin: 24px 0 0 28px;
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 20px; padding: 7px 16px;
  color: rgba(255,255,255,0.7); font-size: 13px;
  font-family: var(--font); cursor: pointer;
  text-decoration: none; transition: all 0.15s;
}
.back-btn:hover { background: rgba(255,255,255,0.13); color: #fff; }
.back-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Tile grid ── */
.tiles {
  display: flex; gap: 18px; flex-wrap: wrap;
  justify-content: center;
  padding: 0 28px 56px; max-width: 860px; width: 100%;
}
.tile {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius); padding: 22px 20px 20px;
  width: 190px; cursor: pointer; text-decoration: none;
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
  display: block;
}
.tile:hover {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.26);
  transform: translateY(-4px);
}
.tile-icon-wrap {
  width: 60px; height: 60px; border-radius: 15px;
  overflow: hidden; margin-bottom: 14px;
}
.tile-icon-wrap canvas { display: block; width: 60px; height: 60px; }
.tile-title { font-size: 14px; font-weight: 500; color: #fff; line-height: 1.3; }
.tile-desc  { font-size: 11px; color: rgba(255,255,255,0.38); margin-top: 4px; font-weight: 300; line-height: 1.5; }

/* ── Buttons ── */
.btn {
  display: inline-block; padding: 0.6rem 1.2rem;
  border-radius: 10px; font-family: var(--font);
  font-size: 0.875rem; font-weight: 500;
  cursor: pointer; border: none; text-decoration: none;
  transition: all 0.15s; text-align: center;
}
.btn-primary  { background: var(--lime); color: #0B3A4D; }
.btn-primary:hover { background: var(--lime-dark); }
.btn-secondary {
  background: rgba(255,255,255,0.08); color: var(--white);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.15); }
.btn-danger   { background: rgba(224,82,42,0.85); color: #fff; }
.btn-danger:hover { background: rgba(224,82,42,1); }
.btn-sm  { padding: 0.35rem 0.75rem; font-size: 0.8rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Form elements ── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-size: 0.72rem; font-weight: 500;
  color: var(--white-dim); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 0.4rem;
}
input, select, textarea {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px; padding: 0.6rem 0.9rem;
  color: var(--white); font-family: var(--font);
  font-size: 0.9rem; font-weight: 300; outline: none;
  transition: border-color 0.15s;
}
input::placeholder { color: rgba(255,255,255,0.25); }
input:focus, select:focus, textarea:focus { border-color: rgba(143,204,40,0.5); }
select option { background: #124D63; }

/* ── Glass card ── */
.glass-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(4px);
}

/* ── Row / list items ── */
.data-row {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; padding: 14px 18px;
  margin-bottom: 10px; transition: background 0.15s;
}
.data-row:hover { background: rgba(255,255,255,0.1); }
.data-row-info { flex: 1; }
.data-row-name { font-size: 14px; font-weight: 500; color: #fff; }
.data-row-meta { font-size: 11px; color: var(--white-dim); margin-top: 2px; }

/* ── Badges ── */
.badge {
  display: inline-block; padding: 0.2rem 0.6rem;
  border-radius: 99px; font-size: 0.72rem; font-weight: 500;
}
.badge-maths   { background: rgba(143,204,40,0.2);  color: #8FCC28; }
.badge-english { background: rgba(123,68,204,0.25); color: #b08ef5; }
.badge-done    { background: rgba(143,204,40,0.2);  color: #8FCC28; }
.badge-pending { background: rgba(255,255,255,0.1); color: var(--white-dim); }

/* ── Alert ── */
.alert {
  padding: 0.75rem 1rem; border-radius: 10px;
  font-size: 0.875rem; margin-bottom: 1rem;
}
.alert-info    { background: rgba(29,138,173,0.2);  border: 1px solid rgba(29,138,173,0.4); }
.alert-success { background: rgba(143,204,40,0.15); border: 1px solid rgba(143,204,40,0.35); }
.alert-error   { background: rgba(224,82,42,0.2);   border: 1px solid rgba(224,82,42,0.4); color: #f9a08a; }

/* ── Table ── */
.table-wrap { border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; padding: 0.65rem 1rem;
  font-size: 0.68rem; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--white-dim);
  background: rgba(0,0,0,0.2); border-bottom: 1px solid var(--border);
}
td {
  padding: 0.75rem 1rem; font-size: 0.875rem;
  border-bottom: 1px solid rgba(255,255,255,0.05); color: var(--white);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.04); }

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 200;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #0e4a61; border: 1px solid var(--border);
  border-radius: 18px; padding: 2rem;
  width: 100%; max-width: 440px;
}
.modal h2 { font-size: 1.1rem; font-weight: 500; margin-bottom: 1.25rem; letter-spacing: 0.05em; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* ── Section label ── */
.section-label {
  font-size: 0.68rem; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--white-dim); margin-bottom: 0.75rem;
}

/* ── Utility ── */
.text-lime   { color: var(--lime); }
.text-muted  { color: var(--white-dim); }
.text-sm     { font-size: 0.875rem; }
.text-xs     { font-size: 0.75rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 0.75rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }

/* ============================================================
   SUMMIT LEARNING — SHARED BRAND SYSTEM
   Reusable classes so future pages inherit branding + layout.
   Logo markup pattern (paste into a header/footer):
     <a class="summit-logo-mount" href="..."> [animated <svg class="summit-logo">] 
        <span class="summit-wm">SUMMIT<span class="summit-wm-sub">LEARNING</span></span></a>
   ============================================================ */

/* --- Logo lockup --- */
.summit-logo-mount{display:inline-flex;align-items:center;gap:9px;text-decoration:none}
.summit-logo{width:34px;height:auto;flex:none}
.summit-wm{font-size:16px;font-weight:700;letter-spacing:.12em;line-height:1;color:currentColor}
.summit-wm-sub{display:block;font-size:8px;font-weight:500;letter-spacing:.35em;color:var(--lime);margin-top:2px}
.summit-logo-mount--lg .summit-logo{width:96px}
.summit-logo-mount--lg .summit-wm{font-size:22px}

/* Animated rainbow sweep — applies when the inline gradient uses id="smsweep".
   Pages can instead drive animation via an inline <animateTransform>; this is the CSS fallback for a .summit-logo--hue treatment. */
.summit-logo--hue{animation:summitHue 12s linear infinite}
@keyframes summitHue{from{filter:hue-rotate(0deg)}to{filter:hue-rotate(360deg)}}

/* --- Footer brand mark --- */
.summit-footer{display:flex;align-items:center;justify-content:center;gap:8px;
  padding:10px 16px;font-size:11px;font-weight:600;letter-spacing:.14em;text-transform:uppercase}
.summit-footer .summit-logo{width:22px}
.summit-footer .summit-footer-wm{color:var(--lime-dark,#6fa01e)}

/* --- Desktop fit-on-screen helper -----------------------------------
   Add class="summit-fit" to the top-level page wrapper (a flex column with
   a fixed header and one scrollable main region marked .summit-scroll).
   Mobile / short screens fall back to normal scrolling. */
@media (min-width:821px) and (min-height:640px){
  html.summit-fit-root,body.summit-fit-root{height:100%;overflow:hidden}
  .summit-fit{height:100vh;min-height:0;overflow:hidden;display:flex;flex-direction:column}
  .summit-fit > header,.summit-fit > .summit-fit-head{flex:none}
  .summit-scroll{flex:1 1 auto;min-height:0;overflow:auto}
}

/* --- Respect reduced motion everywhere --- */
@media (prefers-reduced-motion:reduce){
  .summit-logo--hue{animation:none}
  .summit-logo animateTransform{display:none}
}
