/* ============================================================
   MieterScore AI — Design System
   Foundation CSS for Landing, Funnel & Dashboard pages
   ============================================================ */


/* ============================================================
   1. CSS CUSTOM PROPERTIES
   ============================================================ */

:root {
  /* Brand colours */
  --primary:        #1a2b4a;
  --primary-light:  #2d4a7a;
  --accent:         #3b82f6;
  --accent-hover:   #2563eb;
  --accent-light:   #eff6ff;

  /* Semantic colours */
  --success:        #22c55e;
  --success-light:  #f0fdf4;
  --warning:        #f59e0b;
  --warning-light:  #fffbeb;
  --danger:         #ef4444;
  --danger-light:   #fef2f2;

  /* Neutrals */
  --bg:             #f8fafc;
  --bg-white:       #ffffff;
  --bg-subtle:      #f1f5f9;
  --border:         #e2e8f0;
  --border-strong:  #cbd5e1;
  --text:           #1e293b;
  --text-light:     #64748b;
  --text-xlight:    #94a3b8;

  /* Shape */
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      16px;
  --radius-full:    9999px;

  /* Elevation */
  --shadow:         0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md:      0 4px 16px rgba(0, 0, 0, 0.10);
  --shadow-lg:      0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-accent:  0 4px 14px rgba(59, 130, 246, 0.30);

  /* Typography */
  --font:           -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica,
                    Arial, sans-serif;
  --font-mono:      'SF Mono', 'Fira Code', 'Cascadia Code', Consolas,
                    monospace;

  /* Spacing scale */
  --space-1:        0.25rem;   /*  4px */
  --space-2:        0.5rem;    /*  8px */
  --space-3:        0.75rem;   /* 12px */
  --space-4:        1rem;      /* 16px */
  --space-5:        1.5rem;    /* 24px */
  --space-6:        2rem;      /* 32px */
  --space-8:        3rem;      /* 48px */
  --space-10:       4rem;      /* 64px */

  /* Transitions */
  --transition:     150ms ease;
  --transition-md:  250ms ease;
}


/* ============================================================
   2. RESET & BASE
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: pageLoad 0.35s ease forwards;
}

@keyframes pageLoad {
  from { opacity: 0; }
  to   { opacity: 1; }
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
  color: var(--text-light);
  max-width: 68ch;
}

strong { color: var(--text); font-weight: 600; }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-6) 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}


/* ============================================================
   3. LAYOUT — Container & Grid
   ============================================================ */

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.container--narrow {
  max-width: 760px;
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

@media (max-width: 900px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Flex helpers */
.flex          { display: flex; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-col      { display: flex; flex-direction: column; }
.gap-1         { gap: var(--space-1); }
.gap-2         { gap: var(--space-2); }
.gap-3         { gap: var(--space-3); }
.gap-4         { gap: var(--space-4); }


/* ============================================================
   4. HEADER — Sticky, Logo left / Nav right
   ============================================================ */

/* --- Hamburger checkbox (CSS-only mobile menu) --- */
#nav-toggle { display: none; }

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  text-decoration: none;
}

.header__logo img,
.header__logo svg {
  height: 40px;
  width: auto;
}

/* Primary nav */
.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav__link {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  color: var(--text-light);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.nav__link:hover {
  color: var(--primary);
  background: var(--bg-subtle);
  text-decoration: none;
}

.nav__link.active {
  color: var(--accent);
  background: var(--accent-light);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: var(--space-4);
}

/* Hamburger icon (CSS-only) */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
  padding: 0;
  background: none;
  border: none;
  z-index: 110;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: transform var(--transition-md), opacity var(--transition-md);
  transform-origin: center;
}

/* Mobile nav overlay */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .header__nav,
  .header__actions {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: var(--space-4) var(--space-5);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    z-index: 99;
  }

  #nav-toggle:checked ~ .header__inner .header__nav,
  #nav-toggle:checked ~ .header__inner .header__actions {
    display: flex;
  }

  /* Animate hamburger → X when checked */
  #nav-toggle:checked ~ .header__inner .hamburger span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  #nav-toggle:checked ~ .header__inner .hamburger span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  #nav-toggle:checked ~ .header__inner .hamburger span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .nav__link {
    width: 100%;
    padding: var(--space-3) var(--space-2);
    font-size: 1rem;
  }
}


/* ============================================================
   5. BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.5625rem 1.25rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--transition),
    border-color     var(--transition),
    color            var(--transition),
    box-shadow       var(--transition),
    transform        var(--transition);
  user-select: none;
  -webkit-user-select: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary */
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.40);
  color: #ffffff;
  text-decoration: none;
}

/* Secondary (outlined) */
.btn-secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

/* Success */
.btn-success {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.30);
}

.btn-success:hover {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
  text-decoration: none;
}

/* Ghost (text-only) */
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
}

.btn-ghost:hover {
  background: var(--accent-light);
  color: var(--accent-hover);
  text-decoration: none;
}

/* Dark (primary brand) */
.btn-dark {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(26, 43, 74, 0.25);
}

.btn-dark:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: #ffffff;
  text-decoration: none;
}

/* Size modifiers */
.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.8125rem 2rem;
  font-size: 1.0625rem;
  border-radius: var(--radius);
}

/* Full width */
.btn-full { width: 100%; }

/* Icon-only square button */
.btn-icon {
  padding: 0.5625rem;
  aspect-ratio: 1;
}


/* ============================================================
   6. FORM ELEMENTS
   ============================================================ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-group + .form-group {
  margin-top: var(--space-4);
}

label,
.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

.form-label--required::after {
  content: ' *';
  color: var(--danger);
}

/* Base input / select / textarea */
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.input::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--text-xlight);
}

.input:hover,
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="tel"]:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
}

.input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Error state */
.form-group.error .input,
.form-group.error input,
.form-group.error select,
.form-group.error textarea,
.input.error,
input.error,
select.error,
textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.form-error {
  font-size: 0.8125rem;
  color: var(--danger);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.form-error::before {
  content: '⚠';
  font-size: 0.75rem;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--text-light);
}

/* Select wrapper (custom arrow) */
.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text-light);
  pointer-events: none;
}

.select-wrapper select {
  padding-right: 2.5rem;
  cursor: pointer;
}

/* Textarea */
textarea {
  resize: vertical;
  min-height: 100px;
}

/* Checkbox & Radio */
.checkbox-group,
.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.checkbox-label,
.radio-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text);
  user-select: none;
}

.checkbox-label input[type="checkbox"],
.radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Input with icon */
.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper .input-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

.input-icon-wrapper input {
  padding-left: 2.5rem;
}


/* ============================================================
   7. CARD
   ============================================================ */

.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition-md), transform var(--transition-md);
}

.card--hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card--accent {
  border-color: var(--accent);
  border-width: 2px;
}

.card--flat {
  box-shadow: none;
  border-color: var(--border);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.card__title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--primary);
}

.card__body {
  /* no extra styles — use as semantic wrapper */
}

.card__footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* Stat card variant */
.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow);
}

.stat-card__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}

.stat-card__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.stat-card__change {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-top: var(--space-1);
}

.stat-card__change.positive { color: var(--success); }
.stat-card__change.negative { color: var(--danger); }


/* ============================================================
   8. BADGES
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.25em 0.65em;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-success {
  background: var(--success-light);
  color: #15803d;
}

.badge-warning {
  background: var(--warning-light);
  color: #b45309;
}

.badge-danger {
  background: var(--danger-light);
  color: #b91c1c;
}

.badge-info {
  background: var(--accent-light);
  color: #1d4ed8;
}

.badge-neutral {
  background: var(--bg-subtle);
  color: var(--text-light);
}

/* Solid variants */
.badge-success.solid { background: var(--success); color: #fff; }
.badge-warning.solid { background: var(--warning); color: #fff; }
.badge-danger.solid  { background: var(--danger);  color: #fff; }
.badge-info.solid    { background: var(--accent);  color: #fff; }


/* ============================================================
   9. PROGRESS BAR
   ============================================================ */

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar--lg {
  height: 14px;
}

.progress-bar--sm {
  height: 4px;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent), #60a5fa);
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Animated shimmer on progress fill */
.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 100%
  );
  animation: shimmer 1.8s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Colour variants */
.progress-fill--success {
  background: linear-gradient(90deg, var(--success), #4ade80);
}

.progress-fill--warning {
  background: linear-gradient(90deg, var(--warning), #fcd34d);
}

.progress-fill--danger {
  background: linear-gradient(90deg, var(--danger), #f87171);
}

/* Score ring (circular) */
.score-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.score-ring__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.score-ring__value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}


/* ============================================================
   10. STEPS / FUNNEL PROGRESS
   ============================================================ */

.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-8);
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
  position: relative;
}

/* Connector line between steps — removed (sidebar navigation replaces horizontal stepper) */

.step__circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-light);
  z-index: 1;
  transition: all var(--transition-md);
}

.step.active .step__circle {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}

.step.completed .step__circle {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.step__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  text-align: center;
}

.step.active .step__label {
  color: var(--accent);
}

.step.completed .step__label {
  color: var(--success);
}


/* ============================================================
   11. ALERTS / NOTIFICATIONS
   ============================================================ */

.alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  border-left: 4px solid transparent;
  font-size: 0.9375rem;
}

.alert p { max-width: none; }

.alert-success {
  background: var(--success-light);
  border-color: var(--success);
  color: #15803d;
}

.alert-warning {
  background: var(--warning-light);
  border-color: var(--warning);
  color: #92400e;
}

.alert-danger {
  background: var(--danger-light);
  border-color: var(--danger);
  color: #991b1b;
}

.alert-info {
  background: var(--accent-light);
  border-color: var(--accent);
  color: #1e40af;
}


/* ============================================================
   12. TABLE
   ============================================================ */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  background: var(--bg-white);
}

thead {
  background: var(--bg-subtle);
}

thead th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--bg-subtle);
}


/* ============================================================
   13. MODAL / DIALOG
   ============================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-md);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
  width: 100%;
  max-width: 540px;
  transform: translateY(16px);
  transition: transform var(--transition-md);
}

.modal-backdrop.open .modal {
  transform: translateY(0);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.modal__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 1.5rem;
  line-height: 1;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.modal__close:hover {
  color: var(--text);
  background: var(--bg-subtle);
}


/* ============================================================
   14. SECTION UTILITY
   ============================================================ */

.section {
  padding-block: var(--space-10);
}

.section--sm {
  padding-block: var(--space-8);
}

.section--lg {
  padding-block: calc(var(--space-10) * 1.5);
}

.section__header {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

.section__eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.section__title {
  margin-bottom: var(--space-3);
}

.section__subtitle {
  font-size: 1.0625rem;
  color: var(--text-light);
  max-width: 56ch;
  margin-inline: auto;
}


/* ============================================================
   15. UTILITY CLASSES
   ============================================================ */

/* Text alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* Text size */
.text-xs   { font-size: 0.75rem; }
.text-sm   { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg   { font-size: 1.125rem; }
.text-xl   { font-size: 1.25rem; }

/* Text colour */
.text-primary { color: var(--primary); }
.text-accent  { color: var(--accent); }
.text-light   { color: var(--text-light); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }

/* Font weight */
.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

/* Margins */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

/* Padding */
.p-0 { padding: 0; }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }

/* Display */
.hidden        { display: none; }
.block         { display: block; }
.inline-block  { display: inline-block; }
.inline-flex   { display: inline-flex; }

/* Overflow */
.overflow-hidden { overflow: hidden; }

/* Width helpers */
.w-full  { width: 100%; }
.w-auto  { width: auto; }

/* Max-width wrappers */
.max-w-sm  { max-width: 480px; }
.max-w-md  { max-width: 640px; }
.max-w-lg  { max-width: 900px; }

/* Border radius */
.rounded     { border-radius: var(--radius-sm); }
.rounded-md  { border-radius: var(--radius); }
.rounded-lg  { border-radius: var(--radius-lg); }
.rounded-full{ border-radius: var(--radius-full); }

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin-block: var(--space-5);
}

/* Visually hidden (accessible) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


/* ============================================================
   16. FOOTER
   ============================================================ */

.footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.75);
  padding-block: var(--space-8);
  margin-top: auto;
}

.footer a {
  color: rgba(255, 255, 255, 0.75);
  transition: color var(--transition);
}

.footer a:hover {
  color: #ffffff;
  text-decoration: none;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

@media (max-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }
}

.footer__brand h3 {
  color: #ffffff;
  font-size: 1.125rem;
  margin-bottom: var(--space-2);
}

.footer__brand p {
  max-width: 30ch;
  color: rgba(255, 255, 255, 0.6);
}

.footer__col h4 {
  color: #ffffff;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
}

.footer__col ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer__col li a {
  font-size: 0.9375rem;
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: 0.875rem;
}

.footer__legal {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}


/* ============================================================
   17. ANIMATIONS & TRANSITIONS
   ============================================================ */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

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

.animate-fade-in {
  animation: fadeIn 0.4s ease forwards;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(59, 130, 246, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  display: inline-block;
}


/* ============================================================
   18. RESPONSIVE BREAKPOINTS (reference)
   — xs:  < 480px  (phones)
   — sm:  480–768px (large phones / small tablets)
   — md:  768–1024px (tablets)
   — lg:  1024–1280px (small desktop)
   — xl:  > 1280px (desktop)
   ============================================================ */

@media (max-width: 480px) {
  .container {
    padding-inline: var(--space-4);
  }

  .section {
    padding-block: var(--space-8);
  }

  .card {
    padding: var(--space-4);
  }

  h1 { font-size: 1.625rem; }
  h2 { font-size: 1.3rem; }
}

@media (min-width: 1280px) {
  .container {
    padding-inline: var(--space-6);
  }
}
