/* ============================================================
   DECODE MINDSET — Design System
   Palette: Deep violet + electric gold + warm white
   Vibe: Energetic, premium, encouraging — works for teens & adults
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Syne:wght@700;800&display=swap');

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  /* Colors */
  --violet:        #5B2EFF;
  --violet-dark:   #3D1FCC;
  --violet-light:  #EDE8FF;
  --gold:          #FFB800;
  --gold-light:    #FFF4CC;
  --ink:           #0F0A1E;
  --ink-mid:       #3D3657;
  --ink-soft:      #7B6FA0;
  --surface:       #FFFFFF;
  --surface-2:     #F7F5FF;
  --border:        #E8E3F5;
  --success:       #12B76A;
  --error:         #F04438;

  /* Typography */
  --font-display: 'Syne', sans-serif;
  --font-body:    'Plus Jakarta Sans', sans-serif;

  /* Spacing */
  --radius:    12px;
  --radius-lg: 20px;
  --radius-xl: 32px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(91,46,255,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(91,46,255,.12), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 40px rgba(91,46,255,.18), 0 4px 12px rgba(0,0,0,.08);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typography ──────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  color: var(--ink);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 700; }

p { color: var(--ink-mid); }

/* ── Layout helpers ──────────────────────────────────────────── */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.wrap-narrow {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 24px;
}

.center-page {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  background: var(--violet);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  letter-spacing: -.5px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: -.3px;
}

.brand-tagline {
  font-size: 10px;
  color: var(--ink-soft);
  font-weight: 500;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-mid);
  padding: 8px 16px;
  border-radius: var(--radius);
  transition: background .15s, color .15s;
  text-decoration: none;
}

.nav-links a:hover { background: var(--surface-2); color: var(--ink); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform .15s, box-shadow .15s, background .15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--violet);
  color: #fff;
  box-shadow: 0 4px 14px rgba(91,46,255,.35);
}
.btn-primary:hover {
  background: var(--violet-dark);
  box-shadow: 0 6px 20px rgba(91,46,255,.45);
  color: #fff;
  text-decoration: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--violet);
  border: 2px solid var(--violet);
}
.btn-secondary:hover { background: var(--violet-light); text-decoration: none; color: var(--violet); }

.btn-gold {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(255,184,0,.35);
}
.btn-gold:hover {
  background: #e6a500;
  box-shadow: 0 6px 20px rgba(255,184,0,.45);
  color: var(--ink);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-mid);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }

.btn-block { width: 100%; }

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

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-sm);
}

.card-hover {
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--violet);
}

/* ── Form elements ───────────────────────────────────────────── */
.form-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--ink);
}

.form-sub {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin-bottom: 28px;
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-mid);
  margin-bottom: 7px;
  letter-spacing: .1px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  appearance: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(91,46,255,.12);
}

.field input::placeholder { color: var(--ink-soft); }

.field textarea { resize: vertical; min-height: 100px; }

/* ── Error / success banners ─────────────────────────────────── */
.err-banner {
  background: #FEF3F2;
  border: 1px solid #FECDCA;
  color: var(--error);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
}

.ok-banner {
  background: #ECFDF3;
  border: 1px solid #ABEFC6;
  color: #067647;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
}

/* ── Badge ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.badge-violet { background: var(--violet-light); color: var(--violet); }
.badge-gold   { background: var(--gold-light);   color: #8a6000; }
.badge-green  { background: #ECFDF3; color: #067647; }

/* ── Progress bar ────────────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--gold));
  border-radius: 100px;
  transition: width .4s ease;
}

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--ink-soft);
  font-size: 13px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Toast notification ──────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--ink);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease;
  max-width: 340px;
}

.toast.success { background: var(--success); }
.toast.error   { background: var(--error); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utility ─────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-soft   { color: var(--ink-soft); }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mt-8  { margin-top: 32px; }
.mb-4  { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.flex  { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .topbar { padding: 0 20px; }
  .card { padding: 24px 20px; }
  .nav-links .hide-mobile { display: none; }
}
