/* =====================================================================
   AutoKompass Rhein‑Main – Vibrant Energetic UI
   Single stylesheet for all pages (mobile-first, flexbox-only)
   Constraints: Only flexbox layouts, no CSS Grid/Columns
   Brand: Primary #0E3A5E, Secondary #2F4858, Accent #F5C542
   Fonts: Trebuchet MS (display), Arial (body)
   ===================================================================== */
/* ------------------------------
   CSS Reset / Normalize (lite)
   ------------------------------ */
* { box-sizing: border-box; }
*::before, *::after { box-sizing: inherit; }
html, body { margin: 0; padding: 0; height: 100%; }
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: transparent; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0 0 0 1.2rem; }
li { margin: 0.3rem 0; }
:focus { outline: none; }
:focus-visible { outline: 3px solid #F5C542; outline-offset: 2px; }

/* ------------------------------
   Design Tokens (with fallbacks)
   ------------------------------ */
:root {
  --color-primary: #0E3A5E;
  --color-secondary: #2F4858;
  --color-accent: #F5C542;
  --color-bg: #FFFFFF;
  --color-bg-soft: #F7FAFF; /* light energetic base */
  --color-text: #2F4858;
  --color-text-strong: #0E3A5E;
  --color-border: #E3E8EE;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.06);
  --shadow-md: 0 10px 24px rgba(14,58,94,0.18);
  --shadow-lg: 0 18px 40px rgba(14,58,94,0.22);
  --space-8: 8px; --space-12: 12px; --space-16: 16px; --space-20: 20px; --space-24: 24px; --space-32: 32px; --space-40: 40px; --space-60: 60px;
  --transition-fast: 160ms ease;
  --transition-med: 260ms ease;
}

/* ------------------------------
   Base Typography
   ------------------------------ */
body {
  font-family: Arial, Helvetica, sans-serif; /* Body font */
  color: var(--color-text, #2F4858);
  background-color: var(--color-bg, #FFFFFF);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Trebuchet MS", Verdana, Arial, sans-serif; /* Display font */
  color: var(--color-text-strong, #0E3A5E);
  margin: 0 0 12px 0;
  line-height: 1.2;
}

h1 { font-size: 32px; letter-spacing: 0.2px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
p { margin: 0 0 12px 0; }
strong { color: var(--color-text-strong, #0E3A5E); }

/* Scales up on larger screens */
@media (min-width: 768px) {
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }
}
@media (min-width: 1024px) {
  h1 { font-size: 48px; }
  h2 { font-size: 32px; }
  h3 { font-size: 22px; }
}

/* Links */
a { color: var(--color-primary, #0E3A5E); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: #0a2a44; text-decoration: underline; }

/* Lists */
ul { list-style: none; padding: 0; }
ul li { padding-left: 22px; position: relative; }
ul li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--color-accent, #F5C542); position: absolute; left: 0; top: 8px; }
ol { padding-left: 20px; }

/* Containers & Layout (Flex-only) */
.container {
  display: flex; /* flex container as required */
  justify-content: center;
  width: 100%;
  padding: 0 var(--space-16);
}
.content-wrapper {
  display: flex; /* flex container */
  flex-direction: column; /* mobile-first */
  align-items: flex-start;
  gap: var(--space-20);
  width: 100%;
  max-width: 1120px;
  padding: var(--space-24) 0;
}

/* Global section spacing */
section { margin-bottom: 48px; }

/* MANDATORY SPACING/ALIGNMENT PATTERNS (exact as requested) */
.section { margin-bottom: 60px; padding: 40px 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; }
.content-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.text-image-section { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Header */
header {
  position: relative;
  z-index: 800;
  background: #fff;
  border-bottom: 4px solid var(--color-accent, #F5C542);
  box-shadow: var(--shadow-sm);
}
header .content-wrapper {
  flex-direction: row; /* header row */
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  padding: var(--space-16) 0;
}
.logo img { height: 38px; }

/* Desktop nav hidden on mobile */
.main-nav {
  display: none; /* shown at >= 992px */
  align-items: center;
  gap: var(--space-16);
}
.main-nav a {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-secondary, #2F4858);
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
.main-nav a:hover { background: var(--color-bg-soft, #F7FAFF); color: var(--color-primary, #0E3A5E); transform: translateY(-1px); }

.header-ctas {
  display: none; /* shown on larger screens */
  align-items: center;
  gap: var(--space-12);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 10px;
  color: var(--color-primary, #0E3A5E);
  background: var(--color-bg-soft, #F7FAFF);
  border: 2px solid var(--color-accent, #F5C542);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.mobile-menu-toggle:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed; inset: 0;
  display: flex; /* flex container */
  flex-direction: column;
  background: var(--color-primary, #0E3A5E);
  color: #fff;
  padding: var(--space-24);
  transform: translateX(100%);
  transition: transform 280ms ease-in-out;
  z-index: 1000;
}
/* States supported (JS can toggle either) */
.mobile-menu.open, .menu-open .mobile-menu { transform: translateX(0); }

.mobile-menu-close {
  align-self: flex-end;
  color: #fff;
  font-size: 20px;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 8px;
}

.mobile-nav {
  display: flex; /* flex container */
  flex-direction: column;
  gap: 14px;
  margin-top: var(--space-24);
}
.mobile-nav a {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.mobile-nav a:hover { background: rgba(255,255,255,0.16); transform: translateX(3px); }

/* Show desktop nav/CTAs on larger screens */
@media (min-width: 992px) {
  .main-nav { display: flex; }
  .header-ctas { display: flex; }
  .mobile-menu-toggle { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  border: 2px solid transparent;
}
.btn.primary {
  background: var(--color-accent, #F5C542);
  color: var(--color-primary, #0E3A5E);
  box-shadow: 0 8px 20px rgba(245,197,66,0.35);
}
.btn.primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn.primary:active { transform: translateY(0); }

.btn.secondary {
  background: #fff;
  color: var(--color-primary, #0E3A5E);
  border-color: var(--color-accent, #F5C542);
}
.btn.secondary:hover { background: var(--color-bg-soft, #F7FAFF); transform: translateY(-2px); }

/* CTA rows */
.cta-row { display: flex; flex-wrap: wrap; gap: var(--space-12); }

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--color-primary, #0E3A5E); color: #fff; }
.hero .content-wrapper { padding: var(--space-40) 0; }
.hero h1, .hero p, .hero a { color: #fff; }
.hero .cta-row .btn.secondary { background: transparent; color: #fff; border-color: var(--color-accent, #F5C542); }
.hero .cta-row .btn.secondary:hover { background: rgba(255,255,255,0.08); }
/* Energetic accent slab (decorative) */
.hero::before {
  content: "";
  position: absolute; /* decorative allowed */
  top: -30%; right: -20%;
  width: 70%; height: 200%;
  background: rgba(245,197,66,0.15); /* accent sheen */
  transform: rotate(-12deg);
  z-index: 0;
}
.hero .container, .hero .content-wrapper, .hero * { position: relative; z-index: 1; }

/* Trust row & phone snippet */
.trust-row ul { display: flex; flex-wrap: wrap; gap: var(--space-12); }
.trust-row li { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.25); border-radius: 12px; padding: 10px 12px; color: #fff; }
.phone-snippet { display: flex; align-items: center; gap: 10px; color: #fff; }
.phone-snippet img { width: 20px; height: 20px; }
.phone-snippet a { color: #fff; text-decoration: underline; }

/* Text sections */
.text-section {
  display: flex; flex-direction: column; gap: 10px;
  background: #fff;
  border: 1px solid var(--color-border, #E3E8EE);
  border-left: 6px solid var(--color-accent, #F5C542);
  border-radius: 12px;
  padding: 16px 16px 16px 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px; /* ensure >=20px spacing */
}
.text-section h3 { margin-top: 6px; }

/* Testimonial cards – readable (dark text on light bg) */
.testimonial-card {
  background: var(--color-bg-soft, #F7FAFF);
  border: 1px solid var(--color-border, #E3E8EE);
  border-left: 6px solid var(--color-accent, #F5C542);
  border-radius: 14px;
  color: var(--color-text, #2F4858);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px; /* ensure spacing */
}
.testimonial-card p { margin: 0; }

/* Breadcrumb */
.breadcrumb { color: var(--color-secondary, #2F4858); opacity: 0.9; font-size: 14px; }
.breadcrumb a { text-decoration: underline; }

/* Cards (generic) */
.card { background: #fff; border: 1px solid var(--color-border, #E3E8EE); border-radius: 14px; padding: 18px; box-shadow: var(--shadow-sm); transition: transform var(--transition-fast), box-shadow var(--transition-fast); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* Footer */
footer { background: #0C314F; color: #E9F2FA; }
footer .content-wrapper { gap: var(--space-16); padding: var(--space-32) 0; }
footer a { color: #E9F2FA; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.footer-nav a { padding: 8px 10px; border-radius: 8px; transition: background var(--transition-fast), transform var(--transition-fast); }
.footer-nav a:hover { background: rgba(255,255,255,0.08); transform: translateY(-1px); }

/* Forms (generic) */
input[type="text"], input[type="email"], input[type="tel"], textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border, #E3E8EE);
  border-radius: 10px;
  background: #fff;
}
input:focus, textarea:focus { border-color: var(--color-accent, #F5C542); box-shadow: 0 0 0 3px rgba(245,197,66,0.25); }

/* Tables (if any) */
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid var(--color-border, #E3E8EE); padding: 10px; text-align: left; }
th { background: var(--color-bg-soft, #F7FAFF); }

/* Alignment utilities (flex-only) */
.flex { display: flex; }
.center { display: flex; align-items: center; justify-content: center; }
.row { display: flex; flex-direction: row; }
.col { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }

/* Responsive rules */
@media (min-width: 768px) {
  .text-image-section { flex-direction: row; }
}

/* Desktop section layout enhancements (still flex) */
@media (min-width: 1024px) {
  /* For sections with many .text-section blocks, set content into rows using wrap */
  .content-wrapper { flex-wrap: wrap; }
  .content-wrapper > h2 { flex: 1 0 100%; }
  .content-wrapper > .text-section { flex: 1 1 calc(50% - 10px); }
  /* Keep single long blocks full width */
  .content-wrapper > .text-section:only-child { flex-basis: 100%; }
}

/* ---------------------------------------
   Cookie Consent Banner & Preferences Modal
   --------------------------------------- */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--color-primary, #0E3A5E);
  color: #fff;
  border: 2px solid var(--color-accent, #F5C542);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-lg);
  transform: translateY(140%);
  opacity: 0; pointer-events: none;
  transition: transform var(--transition-med), opacity var(--transition-med);
  z-index: 900;
}
.cookie-banner.show, .cookie-banner.visible { transform: translateY(0); opacity: 1; pointer-events: auto; }
.cookie-banner .cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-banner .btn { padding: 10px 14px; border-radius: 10px; }
.cookie-banner .btn.accept { background: var(--color-accent, #F5C542); color: var(--color-primary, #0E3A5E); border-color: transparent; }
.cookie-banner .btn.reject { background: #fff; color: var(--color-primary, #0E3A5E); border: 2px solid var(--color-accent, #F5C542); }
.cookie-banner .btn.settings { background: rgba(255,255,255,0.1); color: #fff; border: 2px solid rgba(255,255,255,0.2); }
.cookie-banner .btn:hover { transform: translateY(-1px); }

/* Cookie modal (preferences) */
.cookie-modal {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5);
  z-index: 1001;
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity var(--transition-med), transform var(--transition-med);
}
.cookie-modal.show, .cookie-modal.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.cookie-dialog {
  display: flex; flex-direction: column; gap: 14px;
  background: #fff;
  color: var(--color-text, #2F4858);
  width: min(720px, 92vw);
  border-radius: 14px; border: 1px solid var(--color-border, #E3E8EE);
  box-shadow: var(--shadow-lg);
  padding: 18px;
}
.cookie-dialog .cookie-cats { display: flex; flex-direction: column; gap: 10px; }
.cookie-cat { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--color-border, #E3E8EE); border-radius: 10px; padding: 12px; }
.cookie-cat .label { display: flex; flex-direction: column; gap: 4px; }
.cookie-cat .toggle { display: flex; align-items: center; }
/* Toggle pill */
.toggle-switch {
  width: 48px; height: 28px; border-radius: 999px; position: relative; background: #D9DEE4; transition: background var(--transition-fast);
}
.toggle-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: left var(--transition-fast);
}
.toggle-switch.on { background: #F5C542; }
.toggle-switch.on::after { left: 23px; }

.cookie-dialog .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.cookie-dialog .btn.save { background: var(--color-accent, #F5C542); color: var(--color-primary, #0E3A5E); }
.cookie-dialog .btn.cancel { border: 2px solid var(--color-accent, #F5C542); color: var(--color-primary, #0E3A5E); background: #fff; }

/* ---------------------------------------
   Additional Micro-interactions
   --------------------------------------- */
.btn, .main-nav a, .card, .testimonial-card, .text-section { will-change: transform, box-shadow; }

/* ---------------------------------------
   Page-specific small helpers
   --------------------------------------- */
.hero p.breadcrumb, .breadcrumb { opacity: 0.9; }

/* Ensure minimum 20px spacing between blocks */
.content-wrapper > * + * { margin-top: 0; }
.content-wrapper > .text-section,
.content-wrapper > .testimonial-card,
.content-wrapper > .card { margin-bottom: 20px; }

/* Improve readability of long legal pages */
.hero + section .text-section, main section .text-section { padding: 18px; }

/* ---------------------------------------
   Responsive Enhancements (Flex-only)
   --------------------------------------- */
@media (min-width: 768px) {
  .trust-row ul { gap: var(--space-16); }
  .logo img { height: 44px; }
}

@media (min-width: 1200px) {
  .content-wrapper { max-width: 1200px; }
}

/* ---------------------------------------
   Accessibility and contrast tweaks
   --------------------------------------- */
::selection { background: var(--color-accent, #F5C542); color: var(--color-primary, #0E3A5E); }

/* ---------------------------------------
   Safety: Prevent overlap and ensure spacing
   --------------------------------------- */
section, .text-section, .testimonial-card, .card { overflow: visible; }

/* ---------------------------------------
   Ensure flex alignment rules
   --------------------------------------- */
.text-image-section { align-items: center; }
.card-container, .content-grid, .cta-row, .footer-nav, .mobile-nav { align-items: center; }

/* End of stylesheet */
