/* =======================================================
   VARIABLES
   ======================================================= */
:root {
  /* Colors */
  --color-background: #f7f8fa;
  --color-surface: #ffffff;
  --color-text: #23272f;
  --color-primary: #2262c6;
  --color-primary-hover: #16408e;
  --color-success: #36b37e;
  --color-warning: #f7b801;
  --color-danger: #ed254e;
  --color-neutral-50: #fafbfc;
  --color-neutral-100: #f1f2f7;
  --color-neutral-200: #e6e8ef;
  --color-neutral-300: #c5c9d7;
  --color-neutral-400: #9da3b4;
  --color-neutral-500: #697386;
  --color-neutral-700: #383e4c;

  /* Typography */
  --font-main: 'Inter', 'Segoe UI', Arial, sans-serif;
  --font-mono: 'Fira Mono', 'Menlo', 'Monaco', monospace;
  --font-size-xs: 0.8125rem;
  --font-size-sm: 0.9375rem;
  --font-size-base: 1rem;
  --font-size-md: 1.125rem;
  --font-size-lg: 1.3125rem;
  --font-size-xl: 1.625rem;
  --font-size-2xl: 2.125rem;
  --line-height-tight: 1.15;
  --line-height-base: 1.6;
  --line-height-loose: 1.75;

  /* Spacing scale (0, 4, 8 ... 96) */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(20, 31, 68, 0.04);
  --shadow-sm: 0 2px 8px rgba(20, 31, 68, 0.07);
  --shadow-md: 0 4px 16px rgba(20, 31, 68, 0.10);
  --shadow-lg: 0 8px 32px rgba(20, 31, 68, 0.16);

  /* Transition durations */
  --transition-fast: 120ms;
  --transition-base: 240ms;
  --transition-slow: 360ms;
}

/* =======================================================
   RESET & NORMALIZE
   ======================================================= */
html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}
*, *::before, *::after {
  box-sizing: inherit;
}
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
  margin: 0;
}
ul[role='list'], ol[role='list'] {
  list-style: none;
}
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}
button, input, select, textarea {
  font: inherit;
  outline: none;
  background: none;
  border: none;
}
table {
  border-collapse: collapse;
  width: 100%;
}

/* Remove animations/transitions if user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =======================================================
   BASE STYLES
   ======================================================= */
body {
  font-family: var(--font-main);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background: var(--color-background);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--color-text);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-2);
}
h1 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-6);
}
h2 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-4);
}
h3 {
  font-size: var(--font-size-lg);
}
h4 {
  font-size: var(--font-size-md);
}
h5 {
  font-size: var(--font-size-base);
}
h6 {
  font-size: var(--font-size-sm);
}

p {
  margin-bottom: var(--space-4);
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  transition: color var(--transition-base) cubic-bezier(.4,0,.2,1);
}
a:hover, a:focus-visible {
  color: var(--color-primary-hover);
  text-decoration-thickness: 2px;
}
a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

strong, b {
  font-weight: 600;
}

hr {
  border: none;
  border-top: 1px solid var(--color-neutral-200);
  margin: var(--space-8) 0;
}

/* =======================================================
   UTILITIES
   ======================================================= */
.container {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.flex {
  display: flex;
  gap: var(--space-4);
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: var(--space-2);
}
.gap-4 {
  gap: var(--space-4);
}
.grid {
  display: grid;
  gap: var(--space-4);
}

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

/* =======================================================
   COMPONENTS
   ======================================================= */
/* Button */
.button, button, [type="button"], [type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: background var(--transition-base) cubic-bezier(.4,0,.2,1), box-shadow var(--transition-base);
  text-decoration: none;
}
.button:hover, button:hover, [type="button"]:hover, [type="submit"]:hover,
.button:focus-visible, button:focus-visible, [type="button"]:focus-visible, [type="submit"]:focus-visible {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-sm);
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.button:disabled, button:disabled, [type="button"]:disabled, [type="submit"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--color-neutral-200);
  color: var(--color-neutral-500);
}

/* Input Fields */
input, textarea, select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-base);
  box-shadow: none;
  color: var(--color-text);
  transition: border var(--transition-fast) cubic-bezier(.4,0,.2,1), box-shadow var(--transition-fast);
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(34,98,198,.10);
  outline: 2px solid var(--color-primary);
  outline-offset: 1.5px;
}
input:disabled, textarea:disabled, select:disabled {
  background: var(--color-neutral-100);
  color: var(--color-neutral-400);
  opacity: 0.7;
  cursor: not-allowed;
}

/* Card component */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  transition: box-shadow var(--transition-base);
}
.card:hover {
  box-shadow: var(--shadow-lg);
}

/* Accessibility: focus outlines always visible on keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* =======================================================
   HEADER & FOOTER STYLES (shared across all pages)
   ======================================================= */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-neutral-100);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow-xs);
}
.site-logo .logo-text {
  font-family: var(--font-main);
  font-size: var(--font-size-xl);
  color: var(--color-primary);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
}

.main-nav {
  position: relative;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}
.nav-menu li a {
  font-weight: 500;
  font-size: var(--font-size-base);
  text-decoration: none;
  padding: 6px 0;
  transition: color var(--transition-base), border var(--transition-fast);
  border-bottom: 2px solid transparent;
  color: var(--color-neutral-700);
  background: none;
}
.nav-menu li a:hover {
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
}
.cta-header {
  margin-left: var(--space-2);
  font-weight: 700;
  font-size: var(--font-size-base);
}

/* Hamburger button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: var(--color-primary);
  transition: all var(--transition-fast);
}

@media (max-width: 768px) {
  .nav-menu {
    flex-direction: column;
    align-items: flex-start;
    background: var(--color-surface);
    position: absolute;
    top: 48px;
    right: 0;
    width: 220px;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: none;
    z-index: 1001;
  }
  .nav-menu.active {
    display: flex;
  }
  .nav-toggle {
    display: flex;
  }
}

/* Footer styles */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-neutral-200);
  padding-top: var(--space-8);
  padding-bottom: var(--space-4);
  margin-top: var(--space-24);
  font-size: var(--font-size-sm);
}
.footer-brand .logo-text {
  font-size: var(--font-size-lg);
  color: var(--color-primary);
  font-weight: 700;
}
.footer-nav ul, .footer-legal ul {
  padding: 0;
  margin: 0;
  list-style: none;
}
.footer-nav a, .footer-legal a {
  color: var(--color-neutral-700);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.footer-nav a:hover, .footer-legal a:hover {
  color: var(--color-primary);
}
.footer-copy {
  margin-top: var(--space-2);
  text-align: center;
}
@media (max-width: 768px) {
  .site-footer .container {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
  .footer-copy {
    text-align: left;
  }
}

/* =======================================================
   COOKIE CONSENT BANNER (shared across all pages)
   ======================================================= */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  border-top: 1px solid var(--color-neutral-200);
  z-index: 9999;
  padding: var(--space-4) 0;
  display: none;
}
.cookie-consent-banner.visible {
  display: block;
  animation: fade-in var(--transition-slow) cubic-bezier(.4,0,.2,1);
}
.cookie-consent-content {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: center;
  justify-content: center;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}
.cookie-buttons {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
@media (max-width: 650px) {
  .cookie-consent-content {
    flex-direction: column;
    align-items: flex-start;
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* =======================================================
   RESPONSIVE TYPOGRAPHY & LAYOUT
   ======================================================= */
@media (max-width: 768px) {
  .container {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }
  h1 {
    font-size: var(--font-size-xl);
  }
  h2 {
    font-size: var(--font-size-lg);
  }
  h3 {
    font-size: var(--font-size-md);
  }
  .card {
    padding: var(--space-4);
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: var(--font-size-lg);
  }
  h2, h3, h4 {
    font-size: var(--font-size-base);
  }
  .card {
    padding: var(--space-3);
  }
}
