/* ========================================================================== */
/* Variables                                                                */
/* ========================================================================== */
:root {
  /* Colors */
  --color-background: #f7f9fb;
  --color-surface: #fff;
  --color-text: #13171e;
  --color-primary: #246ff4;
  --color-success: #22b573;
  --color-warning: #ffbe3d;
  --color-danger: #ea2845;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f1f3f6;
  --color-gray-200: #e2e6ea;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #22272f;
  --color-gray-900: #11141b;

  /* Typography */
  --font-family-sans: 'Inter', 'Segoe UI', Arial, Helvetica, sans-serif;
  --font-family-mono: 'Fira Mono', 'Menlo', 'Monaco', monospace;
  --font-size-xs: 0.8125rem;
  --font-size-sm: 0.9375rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.375rem;
  --font-size-2xl: 1.75rem;
  --font-size-3xl: 2.25rem;
  --line-height-tight: 1.2;
  --line-height-base: 1.5;
  --line-height-loose: 1.7;

  /* Spacing (scale: 0, 4, 8, 12, 16, ..., 96) */
  --space-0: 0px;
  --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-20: 80px;
  --space-24: 96px;

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

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(34, 39, 47, 0.04);
  --shadow-sm: 0 2px 8px 0 rgba(34, 39, 47, 0.08);
  --shadow-md: 0 4px 16px rgba(34, 39, 47, 0.12);
  --shadow-lg: 0 8px 32px rgba(34, 39, 47, 0.16);

  /* Transitions */
  --duration-fast: 0.15s;
  --duration-base: 0.3s;
  --duration-slow: 0.5s;
}

/* ========================================================================== */
/* Reset & Normalize                                                          */
/* ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dt,
dd {
  margin: 0;
  padding: 0;
}

ul[class],
ol[class] {
  padding: 0;
  margin: 0;
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
select,
textarea {
  font: inherit;
  color: inherit;
  background-color: transparent;
  border: none;
  outline: none;
}

button,
input[type='button'],
input[type='submit'] {
  cursor: pointer;
}

/* Remove input autofill background on Chrome */
input:-webkit-autofill {
  box-shadow: 0 0 0 1000px var(--color-surface) inset !important;
  -webkit-text-fill-color: var(--color-text) !important;
}

/* Responsive media */
audio,
iframe,
video,
img {
  max-width: 100%;
  height: auto;
}

/* ========================================================================== */
/* Base Styles                                                                */
/* ========================================================================== */
body {
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-background);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1 {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-5);
}

h2 {
  font-size: var(--font-size-2xl);
  font-weight: 600;
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-4);
}

h3 {
  font-size: var(--font-size-xl);
  font-weight: 500;
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-3);
}

h4,
h5,
h6 {
  font-size: var(--font-size-lg);
  font-weight: 500;
  margin-bottom: var(--space-2);
}

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

a {
  color: var(--color-primary);
  text-decoration: underline;
  transition: color var(--duration-base);
}

a:hover,
a:focus-visible {
  color: var(--color-primary);
  text-decoration-thickness: 2px;
  outline: none;
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ========================================================================== */
/* Utilities                                                                  */
/* ========================================================================== */
.container {
  width: 100%;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.flex {
  display: flex !important;
}
.flex-center {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.flex-col {
  flex-direction: column !important;
}
.grid {
  display: grid !important;
}
.gap-4 {
  gap: var(--space-4);
}
.gap-8 {
  gap: var(--space-8);
}
.text-center {
  text-align: center !important;
}

.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;
}

/* Divider */
.divider {
  border: none;
  height: 1px;
  background: var(--color-gray-200);
  margin: var(--space-8) 0;
}

/* ========================================================================== */
/* Components                                                                 */
/* ========================================================================== */
/* Buttons */
.button,
button,
input[type="button"],
input[type="submit"] {
  display: inline-block;
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  line-height: 1.2;
  font-weight: 500;
  background-color: var(--color-primary);
  color: #fff;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  border: none;
  box-shadow: var(--shadow-xs);
  transition: background-color var(--duration-base), box-shadow var(--duration-fast), color var(--duration-fast);
  cursor: pointer;
  text-decoration: none;
  letter-spacing: .01em;
}
.button:focus-visible,
button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.button:hover:not(:disabled),
button:hover:not(:disabled),
input[type="button"]:hover:not(:disabled),
input[type="submit"]:hover:not(:disabled) {
  background-color: #1955c9;
  box-shadow: var(--shadow-sm);
}
.button:disabled,
button:disabled,
input[type="button"]:disabled,
input[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-xs);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(36, 111, 244, 0.15);
  outline: none;
}
input[disabled],
select[disabled],
textarea[disabled] {
  background: var(--color-gray-100);
  color: var(--color-gray-400);
  cursor: not-allowed;
  opacity: 0.7;
}

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

/* ========================================================================== */
/* Header & Footer styles                                                     */
/* ========================================================================== */
.site-header {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-row {
  justify-content: space-between!important;
  min-height: 72px;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.site-logo {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  letter-spacing: 0.01em;
  display: inline-block;
}

.header-menu,
.footer-links {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.header-menu li {
  list-style: none;
}

.header-menu a {
  font-weight: 500;
  font-size: var(--font-size-base);
  color: var(--color-gray-800);
  text-decoration: none;
  padding: var(--space-1) var(--space-2);
  transition: color var(--duration-base);
  border-radius: var(--radius-sm);
}

.header-menu a:focus,
.header-menu a:hover {
  color: var(--color-primary);
  background: var(--color-gray-100);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
}

.menu-bar {
  width: 25px;
  height: 3px;
  background: var(--color-gray-700);
  border-radius: 2px;
  transition: all var(--duration-base);
  display: block;
}

@media (max-width: 940px) {
  .header-menu {
    gap: var(--space-2);
  }
}

@media (max-width: 800px) {
  .mobile-menu-toggle {
    display: flex;
  }
  .header-menu {
    position: absolute;
    top: 70px;
    right: 16px;
    left: 16px;
    flex-direction: column;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-6) var(--space-4) var(--space-4) var(--space-4);
    z-index: 200;
    display: none;
  }
  .header-menu.open {
    display: flex;
  }
  .header-menu li {
    width: 100%;
    text-align: left;
  }
  .hide-desktop {
    display: block !important;
  }
}

@media (min-width: 801px) {
  .hide-desktop { display: none !important; }
}

.site-footer {
  background: var(--color-surface);
  margin-top: var(--space-12);
  border-top: 1px solid var(--color-gray-200);
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  position: relative;
  z-index: 20;
}
.footer-content {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-8);
  padding-top: var(--space-8);
  padding-bottom: var(--space-4);
}
.site-logo-footer {
  font-weight: 700;
  color: var(--color-primary);
  font-size: var(--font-size-lg);
  display: block;
  margin-bottom: var(--space-2);
}
.footer-description {
  color: var(--color-gray-500);
}
.footer-links {
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-start;
  padding-left: 0;
}
.footer-links.legal {
  margin-top: var(--space-0);
  color: var(--color-gray-500);
}
.footer-links a {
  color: inherit;
  text-decoration: none;
  transition: color .2s;
  padding: 2px 0;
}
.footer-links a:hover,
.footer-links a:focus {
  color: var(--color-primary);
  text-decoration: underline;
}
.copyright {
  border-top: 1px solid var(--color-gray-100);
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  text-align: center;
  font-size: var(--font-size-xs);
}
/* Cookie consent */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  background: var(--color-surface);
  box-shadow: 0 -2px 16px rgba(34, 39, 47, 0.10);
  z-index: 9999;
  display: none;
  padding: var(--space-3) 0;
  font-size: var(--font-size-sm);
}
.cookie-banner.is-visible {
  display: block;
}
.cookie-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-4);
}
.cookie-text a {
  color: var(--color-primary);
  text-decoration: underline;
}
.cookie-actions {
  display: flex;
  gap: var(--space-2);
}
@media (max-width: 700px) {
  .cookie-container {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    text-align: left;
  }
}

/* ========================================================================== */
/* Accessibility & Reduced Motion                                             */
/* ========================================================================== */
:focus:not(:focus-visible) {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Responsive utilities */
@media (max-width: 700px) {
  .container {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }
  .card {
    padding: var(--space-4);
  }
}
