/* =========================================================
   VARIABLES
   ========================================================= */
:root {
  /* Colors */
  --color-background: #fafafb;
  --color-text: #232429;
  --color-primary: #2376e0;
  --color-success: #20b37a;
  --color-warning: #ffb400;
  --color-danger: #d7263d;
  --gray-50:  #f6f7f8;
  --gray-100: #eceef0;
  --gray-200: #d7dae0;
  --gray-300: #b6bbc6;
  --gray-400: #969cac;
  --gray-500: #7d8192;
  --gray-600: #636676;
  --gray-700: #43454e;
  --gray-800: #2e2f35;
  --gray-900: #1b1b1d;

  /* Typography */
  --font-family-sans: "Inter", "Roboto", Arial, Helvetica, sans-serif;
  --font-family-serif: "Merriweather", serif;
  --font-family-mono: "Menlo", "Monaco", "Consolas", monospace;
  --font-size-root: 100%; /* 16px */
  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-lg: 1.25rem;   /* 20px */
  --font-size-xl: 1.5rem;    /* 24px */
  --font-size-2xl: 2rem;     /* 32px */
  --line-height-base: 1.6;
  --line-height-title: 1.1;

  /* Spacing scale */
  --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;
  --radius-round: 999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(35, 36, 41, 0.03);
  --shadow-sm: 0 2px 8px rgba(35, 36, 41, 0.06);
  --shadow-md: 0 6px 24px rgba(35, 36, 41, 0.10);
  --shadow-lg: 0 12px 48px rgba(35, 36, 41, 0.12);

  /* Transitions */
  --transition-fast: 120ms cubic-bezier(0.4,0,0.2,1);
  --transition-medium: 200ms cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 400ms cubic-bezier(0.4,0,0.2,1);
}

/* =========================================================
   RESET / NORMALIZE
   ========================================================= */
html {
  box-sizing: border-box;
  font-size: var(--font-size-root);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--color-background);
}
*, *::before, *::after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
  border: 0;
}
body {
  min-height: 100vh;
}
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}
ul, ol {
  list-style: none;
}
a {
  text-decoration: none;
  color: inherit;
}
button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
  box-shadow: none;
  appearance: none;
}
button {
  cursor: pointer;
  background: none;
}
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
::-webkit-input-placeholder { color: var(--gray-400); }
::-moz-placeholder { color: var(--gray-400); }
:-ms-input-placeholder { color: var(--gray-400); }
::placeholder { color: var(--gray-400); }

/* Reduce motion if user prefers */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0ms !important;
    transition-duration: 0ms !important;
  }
}

/* =========================================================
   BASE STYLES
   ========================================================= */
body {
  font-family: var(--font-family-sans);
  color: var(--color-text);
  background: var(--color-background);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: var(--line-height-title);
  margin-bottom: var(--space-3);
  color: var(--color-text);
  letter-spacing: -0.02em;
}
h1 {
  font-size: var(--font-size-2xl);
  margin-top: var(--space-8);
}
h2 {
  font-size: var(--font-size-xl);
  margin-top: var(--space-6);
}
h3 {
  font-size: var(--font-size-lg);
  margin-top: var(--space-5);
}
h4 {
  font-size: var(--font-size-base);
  margin-top: var(--space-4);
}
h5, h6 {
  font-size: var(--font-size-sm);
  margin-top: var(--space-3);
}

p {
  max-width: 65ch;
  margin-bottom: var(--space-4);
  line-height: var(--line-height-base);
  color: var(--color-text);
  font-size: var(--font-size-base);
}

a {
  color: var(--color-primary);
  transition: color var(--transition-fast);
}
a:hover, a:focus-visible {
  color: var(--color-primary);
  text-decoration: underline;
}

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

/* =========================================================
   UTILITIES
   ========================================================= */

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

.flex {
  display: flex;
}
.flex-center {
  align-items: center;
  justify-content: center;
}
.flex-col {
  flex-direction: column;
}
.gap-4 {
  gap: var(--space-4);
}
.grid {
  display: grid;
}
.grid-2 {
  grid-template-columns: 1fr 1fr;
}
.grid-gap-8 {
  gap: var(--space-8);
}

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

/* =========================================================
   COMPONENTS
   ========================================================= */

.button,
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-3) var(--space-6);
  font-size: var(--font-size-base);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  box-shadow: var(--shadow-xs);
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}
.button:hover,
button:hover,
.button:focus-visible,
button:focus-visible {
  background: #195cb6;
  box-shadow: var(--shadow-sm);
}
.button:disabled,
button:disabled {
  background: var(--gray-200);
  color: var(--gray-500);
  cursor: not-allowed;
  box-shadow: none;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-base);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-text);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(35, 118, 224, 0.1);
  outline: none;
}
input:disabled,
select:disabled,
textarea:disabled {
  background: var(--gray-100);
  color: var(--gray-400);
  cursor: not-allowed;
}

.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
  transition: box-shadow var(--transition-fast);
}
.card:hover {
  box-shadow: var(--shadow-lg);
}

/* =========================================================
   HEADER & FOOTER STYLES
   ========================================================= */

.site-header {
  background: #fff;
  box-shadow: var(--shadow-xs);
  padding: var(--space-2) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.site-logo {
  display: flex;
  align-items: center;
  font-weight: 800;
  font-size: 1.375rem;
  color: var(--color-primary);
  letter-spacing: -1px;
  line-height: 1;
}
.logo-text {
  padding-left: 0;
}

.nav-list {
  display: flex;
  column-gap: var(--space-6);
  row-gap: var(--space-2);
  align-items: center;
  font-weight: 500;
  font-size: 1rem;
  transition: max-height var(--transition-fast);
  list-style: none;
}

.nav-list li a {
  color: var(--gray-700);
  padding: var(--space-2) var(--space-1);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.nav-list li a:hover,
.nav-list li a:focus-visible {
  background: var(--gray-50);
  color: var(--color-primary);
}

/* Responsive Nav */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: var(--space-2);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  min-width: 44px;
  min-height: 44px;
}
.nav-toggle-bar {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: transform 0.2s;
}

@media (max-width: 900px) {
  .nav-list {
    position: absolute;
    right: 0;
    top: 62px;
    background: #fff;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    padding: var(--space-6) var(--space-8) var(--space-6) var(--space-6);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-medium);
    border-bottom-left-radius: var(--radius-lg);
    align-items: flex-start;
    width: 240px;
    margin: 0;
    z-index: 999;
  }
  .nav-list.open {
    max-height: 420px;
    padding-bottom: var(--space-8);
    box-shadow: var(--shadow-lg);
  }
  .nav-toggle {
    display: flex;
  }
}

.site-footer {
  background: var(--gray-900);
  color: #fff;
  padding: var(--space-8) 0 var(--space-4) 0;
  position: relative;
}
.footer-main {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-8);
  margin-bottom: var(--space-4);
}
.footer-brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-primary);
}
.footer-title {
  color: #fff;
}
.footer-nav ul,
.footer-legal ul {
  list-style: none;
  padding: 0;
}
.footer-links li, .footer-legal-links li {
  margin-bottom: var(--space-2);
}
.footer-links li a, .footer-legal-links li a {
  color: #ddd;
  font-size: var(--font-size-base);
  transition: color 0.15s;
}
.footer-links li a:hover, .footer-legal-links li a:hover {
  color: var(--color-primary);
}
.copyright {
  border-top: 1px solid var(--gray-800);
  padding-top: var(--space-2);
  text-align: center;
  color: var(--gray-300);
  font-size: 0.95rem;
  margin-bottom: var(--space-1);
}

/* Cookie Consent */
.cookie-consent {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.97);
  border-top: 1px solid var(--gray-200);
  box-shadow: var(--shadow-lg);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4) var(--space-2);
  min-height: 48px;
  opacity: 1;
  transition: opacity 0.2s;
}
.cookie-consent[hidden] {
  opacity: 0;
  pointer-events: none;
}
.cookie-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
  max-width: 800px;
  font-size: var(--font-size-base);
}
.cookie-actions button {
  margin-left: var(--space-2);
  min-width: 115px;
}
.button-outline {
  background: transparent;
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
  box-shadow: none;
}
.button-outline:hover,
.button-outline:focus-visible {
  background: var(--color-primary);
  color: #fff;
}

@media (max-width: 700px) {
  .footer-main {
    flex-direction: column;
    gap: var(--space-4);
    align-items: flex-start;
  }
  .cookie-content {
    flex-direction: column;
    gap: var(--space-3);
    align-items: flex-start;
  }
}

@media (max-width: 500px) {
  .site-footer {
    padding: var(--space-4) 0 var(--space-2) 0;
    font-size: var(--font-size-sm);
  }
}

/* =========================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================= */
@media (max-width: 900px) {
  .container {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.15rem; }
  h3 { font-size: 1rem; }
  .card {
    padding: var(--space-4);
  }
}
