/* ==========================================================================
   DESIGN SYSTEM — CSS
   Brand colors: Yellow #FFF468 · Purple #492A6F
   Typeface: Poppins (Light 300 / Medium 500 / Bold 700)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. FONT IMPORT (Poppins — Light, Medium, Bold + italics)
   -------------------------------------------------------------------------- */
/* Poppins is loaded by a <link> in each page's <head> (faster than @import) */

/* --------------------------------------------------------------------------
   2. DESIGN TOKENS (CSS Custom Properties)
   -------------------------------------------------------------------------- */
:root {

  /* ---- Color: Yellow scale (Primary) ---- */
  --color-yellow-50:  #FFFEF3;
  --color-yellow-100: #FFFDE7;
  --color-yellow-200: #FFFBCF;
  --color-yellow-300: #FFFAB7;
  --color-yellow-400: #FFF792;
  --color-yellow-500: #FFF468; /* base brand yellow */
  --color-yellow-600: #D6CD57;
  --color-yellow-700: #ADA647;
  --color-yellow-800: #857F36;
  --color-yellow-900: #5C5825;
  --color-yellow-950: #333115;

  /* ---- Color: Purple scale (Secondary) ---- */
  --color-purple-50:  #492A6F;
  --color-purple-100: #492A6F;
  --color-purple-200: #492A6F;
  --color-purple-300: #492A6F;
  --color-purple-400: #492A6F;
  --color-purple-500: #492A6F; /* base brand purple */
  --color-purple-600: #492A6F;
  --color-purple-700: #492A6F;
  --color-purple-800: #492A6F;
  --color-purple-900: #492A6F;
  --color-purple-950: #492A6F;

  /* ---- Color: Neutral scale (purple-tinted gray) ---- */
  --color-neutral-50:  #FAF9FA;
  --color-neutral-100: #F5F4F6;
  --color-neutral-200: #E5E3E8;
  --color-neutral-300: #D3D0D7;
  --color-neutral-400: #ADA7B4;
  --color-neutral-500: #867E91;
  --color-neutral-600: #655E6E;
  --color-neutral-700: #4C4653;
  --color-neutral-800: #332F37;
  --color-neutral-900: #211E24;
  --color-neutral-950: #141316;

  /* ---- Color: Base ---- */
  --color-white: #FFFFFF;
  --color-black: #000000;

  /* ---- Color: Semantic (state) ---- */
  --color-success: #2FA86A;
  --color-warning: #E5A100;
  --color-error:   #D3423E;
  --color-info:    #3D7BD9;

  /* ---- Color: Semantic (role) ---- */
  --bg-default:        var(--color-white);
  --bg-subtle:         var(--color-neutral-50);
  --bg-muted:          var(--color-neutral-100);
  --bg-inverse:        var(--color-purple-900);
  --bg-brand:          var(--color-yellow-500);
  --bg-brand-subtle:   var(--color-yellow-100);

  --text-primary:      var(--color-purple-900);
  --text-secondary:    var(--color-neutral-600);
  --text-disabled:     var(--color-neutral-400);
  --text-inverse:      var(--color-white);
  --text-on-brand:     var(--color-purple-900);
  --text-link:         var(--color-purple-500);

  --border-default:    var(--color-neutral-200);
  --border-strong:     var(--color-neutral-400);
  --border-focus:      var(--color-yellow-500);
  --border-brand:      var(--color-purple-500);

  --action-primary:            var(--color-yellow-500);
  --action-primary-hover:      var(--color-yellow-400);
  --action-primary-active:     var(--color-yellow-600);
  --action-primary-text:       var(--color-purple-900);

  --action-secondary:          var(--color-purple-500);
  --action-secondary-hover:    var(--color-purple-400);
  --action-secondary-active:   var(--color-purple-600);
  --action-secondary-text:     var(--color-white);

  /* ---- Typography: Family & Weight ---- */
  --font-family-base: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-weight-light:  300;
  --font-weight-medium: 500;
  --font-weight-bold:   700;

  /* ---- Typography: Size scale ---- */
  --font-size-xs:   0.75rem;   /* 12px */
  --font-size-sm:   0.875rem;  /* 14px */
  --font-size-base: 1rem;      /* 16px */
  --font-size-lg:   1.125rem;  /* 18px */
  --font-size-xl:   1.25rem;   /* 20px */
  --font-size-2xl:  1.5rem;    /* 24px */
  --font-size-3xl:  1.875rem;  /* 30px */
  --font-size-4xl:  2.25rem;   /* 36px */
  --font-size-5xl:  3rem;      /* 48px */
  --font-size-6xl:  3.75rem;   /* 60px */

  /* ---- Typography: Line height ---- */
  --line-height-tight:   1.1;
  --line-height-snug:    1.25;
  --line-height-normal:  1.5;
  --line-height-relaxed: 1.7;

  /* ---- Typography: Letter spacing ---- */
  --letter-spacing-tight:  -0.02em;
  --letter-spacing-normal: 0em;
  --letter-spacing-wide:   0.04em;

  /* ---- Spacing scale (4px base unit) ---- */
  --space-0:  0;
  --space-1:  0.25rem;  /* 4px */
  --space-2:  0.5rem;   /* 8px */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-5:  1.25rem;  /* 20px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */

  /* ---- Border radius ---- */
  --radius-none: 0;
  --radius-sm:   0.25rem;  /* 4px */
  --radius-md:   0.5rem;   /* 8px */
  --radius-lg:   0.75rem;  /* 12px */
  --radius-xl:   1rem;     /* 16px */
  --radius-2xl:  1.5rem;   /* 24px */
  --radius-full: 9999px;

  /* ---- Border width ---- */
  --border-width-sm: 1px;
  --border-width-md: 2px;
  --border-width-lg: 4px;

  /* ---- Shadows ---- */
  --shadow-sm: 0 1px 2px 0 rgba(26, 15, 40, 0.08);
  --shadow-md: 0 4px 8px 0 rgba(26, 15, 40, 0.12);
  --shadow-lg: 0 8px 24px 0 rgba(26, 15, 40, 0.16);
  --shadow-glow-yellow: 0 0 24px 0 rgba(255, 244, 104, 0.4);

  /* ---- Opacity ---- */
  --opacity-disabled: 0.4;
  --opacity-hover:    0.88;
  --opacity-overlay:  0.64;

  /* ---- Breakpoints (reference values — use in media queries manually) ---- */
  --breakpoint-sm:  375px;
  --breakpoint-md:  768px;
  --breakpoint-lg:  1024px;
  --breakpoint-xl:  1280px;
  --breakpoint-2xl: 1536px;

  /* ---- Motion ---- */
  --duration-fast:   120ms;
  --duration-base:   200ms;
  --duration-slow:   320ms;
  --easing-standard: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   3. DARK THEME OVERRIDE (optional — toggle via [data-theme="dark"])
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  --bg-default:      var(--color-purple-950);
  --bg-subtle:       var(--color-purple-900);
  --bg-muted:        var(--color-purple-800);
  --bg-inverse:      var(--color-yellow-500);

  --text-primary:    var(--color-white);
  --text-secondary:  var(--color-neutral-300);
  --text-disabled:   var(--color-neutral-600);
  --text-inverse:    var(--color-purple-900);

  --border-default:  var(--color-purple-700);
  --border-strong:   var(--color-purple-500);
}

/* --------------------------------------------------------------------------
   4. RESET / BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-light);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--text-primary);
  background-color: var(--bg-default);
}

/* --------------------------------------------------------------------------
   5. TYPOGRAPHY CLASSES
   -------------------------------------------------------------------------- */
.text-display {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-6xl);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
}

.text-h1 {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-5xl);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
}

.text-h2 {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-4xl);
  line-height: var(--line-height-snug);
}

.text-h3 {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-3xl);
  line-height: var(--line-height-snug);
}

.text-h4 {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-2xl);
  line-height: var(--line-height-snug);
}

.text-h5 {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-xl);
  line-height: var(--line-height-normal);
}

.text-h6 {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-normal);
}

.text-body-lg {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-light);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
}

.text-body {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-light);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
}

.text-body-medium {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
}

.text-body-sm {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-light);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
}

.text-label {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-snug);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
}

.text-caption {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-light);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-normal);
  letter-spacing: var(--letter-spacing-wide);
  color: var(--text-secondary);
}

/* Utility weight classes */
.font-light  { font-weight: var(--font-weight-light); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-bold   { font-weight: var(--font-weight-bold); }

/* --------------------------------------------------------------------------
   6. COLOR UTILITIES
   -------------------------------------------------------------------------- */
.bg-brand          { background-color: var(--bg-brand); }
.bg-brand-subtle   { background-color: var(--bg-brand-subtle); }
.bg-inverse        { background-color: var(--bg-inverse); color: var(--text-inverse); }
.bg-subtle         { background-color: var(--bg-subtle); }
.bg-muted          { background-color: var(--bg-muted); }

.text-primary      { color: var(--text-primary); }
.text-secondary    { color: var(--text-secondary); }
.text-inverse      { color: var(--text-inverse); }
.text-link         { color: var(--text-link); }

/* --------------------------------------------------------------------------
   7. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-base);
  line-height: var(--line-height-tight);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  border: var(--border-width-sm) solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  transition: background-color var(--duration-base) var(--easing-standard),
              transform var(--duration-fast) var(--easing-standard),
              box-shadow var(--duration-base) var(--easing-standard);
}

.btn:focus-visible {
  outline: var(--border-width-md) solid var(--border-focus);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: var(--opacity-disabled);
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--action-primary);
  color: var(--action-primary-text);
}
.btn-primary:hover:not(:disabled) { background-color: var(--action-primary-hover); }
.btn-primary:active:not(:disabled) { background-color: var(--action-primary-active); transform: translateY(1px); }

.btn-secondary {
  background-color: var(--action-secondary);
  color: var(--action-secondary-text);
}
.btn-secondary:hover:not(:disabled) { background-color: var(--action-secondary-hover); }
.btn-secondary:active:not(:disabled) { background-color: var(--action-secondary-active); transform: translateY(1px); }

.btn-outline {
  background-color: transparent;
  border-color: var(--border-brand);
  color: var(--action-secondary);
}
.btn-outline:hover:not(:disabled) {
  background-color: var(--color-purple-50);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-primary);
}
.btn-ghost:hover:not(:disabled) { background-color: var(--bg-muted); }

/* --------------------------------------------------------------------------
   8. FORM ELEMENTS
   -------------------------------------------------------------------------- */
.input {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-light);
  font-size: var(--font-size-base);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: var(--border-width-sm) solid var(--border-default);
  background-color: var(--bg-default);
  color: var(--text-primary);
  transition: border-color var(--duration-base) var(--easing-standard);
}

.input::placeholder { color: var(--text-disabled); }

.input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(255, 244, 104, 0.35);
}

.input:disabled {
  background-color: var(--bg-muted);
  opacity: var(--opacity-disabled);
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   9. CARDS
   -------------------------------------------------------------------------- */
.card {
  background-color: var(--bg-default);
  border: var(--border-width-sm) solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.card-brand {
  background-color: var(--bg-brand);
  color: var(--text-on-brand);
  border: none;
}

/* --------------------------------------------------------------------------
   10. BADGES / TAGS
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-xs);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.badge-primary   { background-color: var(--color-yellow-100); color: var(--color-purple-800); }
.badge-secondary { background-color: var(--color-purple-100); color: var(--color-purple-700); }
.badge-success   { background-color: #E4F6ED; color: var(--color-success); }
.badge-warning   { background-color: #FCF0D6; color: var(--color-warning); }
.badge-error     { background-color: #FBE4E3; color: var(--color-error); }

/* --------------------------------------------------------------------------
   11. LAYOUT HELPERS
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--breakpoint-xl);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.divider {
  border: none;
  border-top: var(--border-width-sm) solid var(--border-default);
  margin: var(--space-6) 0;
}
