/* ==========================
   SpryDrive Rentenberatung - Professional Corporate CSS
   Author: Senior CSS Developer & UI Designer
   Notes: Mobile-first, ONLY Flexbox layouts (no grid or columns), high contrast, formal & structured style
   ========================== */

/* --------------------------
   CSS Reset & Base Normalize
   -------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
img, video { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0 0 16px; padding-left: 20px; }
li { margin-bottom: 8px; }
figure { margin: 0; }

/* --------------------------
   Brand Tokens (with fallbacks)
   -------------------------- */
:root {
  --primary: #0B3A63;   /* Navy */
  --secondary: #2F6F7E; /* Teal-gray */
  --accent: #F4F7FA;    /* Light gray-blue */
  --text: #1C1F24;      /* Dark slate */
  --muted: #5A6872;     /* Muted gray */
  --border: #D8E1E8;    /* Light border */
  --bg: #FFFFFF;        /* Page background */
}

/* --------------------------
   Typography
   -------------------------- */
body {
  font-family: Arial, Helvetica, sans-serif; /* business body font */
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: Georgia, 'Times New Roman', serif; /* formal display font */
  color: var(--primary);
  line-height: 1.25;
  margin: 0 0 12px;
}

h1 { font-size: 28px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

p { margin: 0 0 16px; color: var(--text); }
small { color: var(--muted); }
em { color: var(--muted); }
strong { font-weight: 700; color: var(--text); }

/* Links */
a { color: var(--primary); text-decoration: none; transition: color .2s ease, background-color .2s ease; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid #A8C7E6; outline-offset: 2px; border-radius: 4px; }

/* --------------------------
   Layout Containers (Flex-only)
   -------------------------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;           /* flex-only */
  flex-direction: column;  /* column on mobile */
}

.content-wrapper {
  display: flex;           /* flex-only */
  flex-direction: column;  /* column on mobile */
  gap: 20px;               /* consistent spacing */
}

/* Section spacing (also provide class-based pattern) */
section { margin-bottom: 60px; padding: 40px 20px; }
.section { margin-bottom: 60px; padding: 40px 20px; }

/* --------------------------
   Header & Navigation
   -------------------------- */
header { background: #FFFFFF; border-bottom: 1px solid var(--border); position: relative; z-index: 1000; }
header .content-wrapper { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }

.logo img { height: 36px; width: auto; }

.main-nav { display: none; align-items: center; gap: 20px; }
.main-nav a { color: var(--text); padding: 8px 10px; border-radius: 6px; }
.main-nav a:hover { background: var(--accent); color: var(--primary); text-decoration: none; }
.main-nav a[aria-current="page"] { color: var(--primary); font-weight: 700; background: rgba(11,58,99,0.06); }

.header-cta { display: none; align-items: center; }
.header-cta .btn { white-space: nowrap; }

.mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff; color: var(--primary);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.mobile-menu-toggle:hover { background: var(--accent); transform: translateY(-1px); }
.mobile-menu-toggle:focus-visible { outline: 2px solid #A8C7E6; outline-offset: 2px; }

/* Mobile Menu Overlay (covers full screen) */
.mobile-menu {
  position: fixed;
  inset: 0; /* top:0; right:0; bottom:0; left:0 */
  background: #FFFFFF;          /* full-screen panel for clarity and contrast */
  transform: translateX(100%);
  transition: transform .35s ease;
  z-index: 9999;
  display: flex;                /* flex-only */
  flex-direction: column;
  padding: 16px;
  gap: 10px;
}
.mobile-menu[aria-hidden="false"] { transform: translateX(0); }

.mobile-menu-close {
  align-self: flex-end;
  border: 1px solid var(--border);
  background: #fff; color: var(--muted);
  border-radius: 8px;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer;
}
.mobile-menu-close:hover { background: var(--accent); }

.mobile-nav { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.mobile-nav a { padding: 14px 10px; border-radius: 8px; color: var(--text); }
.mobile-nav a:hover { background: var(--accent); color: var(--primary); text-decoration: none; }
.mobile-nav a[aria-current="page"] { background: rgba(11,58,99,0.06); font-weight: 700; }

/* --------------------------
   Hero Section
   -------------------------- */
.hero { background: var(--accent); border-bottom: 1px solid var(--border); }
.hero h1 { color: var(--primary); font-size: 28px; margin-bottom: 8px; }
.hero p { color: var(--muted); font-size: 16px; }
.hero .btn { margin-right: 8px; }

/* --------------------------
   Buttons & Interactions
   -------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: #fff; color: var(--primary);
  font-weight: 600;
  transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  box-shadow: 0 1px 0 rgba(11,58,99,0.04);
}
.btn:hover { background: #EAF3FF; transform: translateY(-1px); box-shadow: 0 8px 16px rgba(11,58,99,0.12); text-decoration: none; }
.btn:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(11,58,99,0.12); }
.btn:focus-visible { outline: 2px solid #A8C7E6; outline-offset: 2px; }

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: #0A3357; border-color: #0A3357; }

/* Subtle badges/chips if needed */
.badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 12px; background: rgba(11,58,99,0.08); color: var(--primary); }

/* --------------------------
   Content Patterns (Flex-only)
   -------------------------- */
/* MANDATORY SPACING & ALIGNMENT PATTERNS */
.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; }

/* Professional card styles */
.text-image-section { flex-direction: column; }
.text-image-section > div {
  flex: 1 1 260px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 16px rgba(17,27,39,0.06);
}

.card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(17,27,39,0.06);
  overflow: hidden;
}

.card .card-content, .feature-item {
  display: flex; flex-direction: column; justify-content: center; gap: 12px;
}

/* Testimonials: high contrast, light background */
.testimonial-card {
  background: #F8FAFC; /* light for readability */
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(17,27,39,0.06);
  color: #1C1F24; /* dark text */
}

/* Lists within cards/sections */
.text-image-section ul, .text-image-section ol { margin: 0; }

/* Ordered lists - corporate numbering spacing */
ol { padding-left: 20px; }
ol li { margin-bottom: 8px; }

/* --------------------------
   Footer
   -------------------------- */
footer { background: var(--primary); color: #EAF2F8; border-top: 1px solid rgba(255,255,255,0.08); }
footer a { color: #EAF2F8; }
footer .content-wrapper { flex-direction: column; gap: 12px; padding: 24px 0; }
footer nav { display: flex; flex-wrap: wrap; gap: 12px 20px; }
footer p { margin: 0; color: #EAF2F8; }

/* --------------------------
   Cookie Consent Banner & Modal
   -------------------------- */
.cookie-banner {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(17,27,39,0.15);
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px; /* flex-only */
  transform: translateY(140%);
  transition: transform .35s ease;
  z-index: 9998;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner p { margin: 0; color: var(--text); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-actions .btn { padding: 10px 14px; }
.cookie-actions .btn-accept { background: var(--primary); color: #fff; border-color: var(--primary); }
.cookie-actions .btn-accept:hover { background: #0A3357; }
.cookie-actions .btn-reject { background: #fff; color: var(--primary); border-color: var(--primary); }
.cookie-actions .btn-settings { background: #fff; color: var(--secondary); border-color: var(--border); }

.cookie-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(10, 18, 24, 0.55);
  display: flex; align-items: center; justify-content: center; /* flex-only */
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.cookie-modal.show { opacity: 1; pointer-events: auto; }
.cookie-modal-content {
  width: 92%; max-width: 720px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(17,27,39,0.25);
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px; /* flex-only */
}
.cookie-modal-header, .cookie-modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cookie-category { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cookie-category:last-child { border-bottom: 0; }

/* Toggle switch (generic) */
.toggle { position: relative; width: 44px; height: 24px; border-radius: 999px; background: #E6EEF5; border: 1px solid var(--border); transition: background .2s ease, border-color .2s ease; display: inline-flex; align-items: center; }
.toggle::after { content: ""; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; border: 1px solid var(--border); transform: translateX(3px); transition: transform .2s ease; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.toggle.is-on { background: var(--secondary); border-color: var(--secondary); }
.toggle.is-on::after { transform: translateX(22px); }

/* --------------------------
   Utilities & Accessibility
   -------------------------- */
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sep { height: 1px; width: 100%; background: var(--border); }

/* --------------------------
   Responsive Enhancements
   -------------------------- */
@media (min-width: 576px) {
  h1 { font-size: 30px; }
  h2 { font-size: 26px; }
}

@media (min-width: 768px) {
  .hero h1 { font-size: 36px; }
  .hero p { font-size: 18px; }
  .text-image-section { flex-direction: row; align-items: stretch; }
  .text-image-section > div { padding: 20px; }
  footer .content-wrapper { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 24px; }
}

@media (min-width: 992px) {
  h1 { font-size: 40px; }
  .main-nav { display: flex; }
  .header-cta { display: flex; }
  .mobile-menu-toggle { display: none; }
  header .content-wrapper { gap: 24px; }
  .content-wrapper { gap: 24px; }
}

@media (min-width: 1200px) {
  .hero h1 { font-size: 42px; }
}

/* --------------------------
   Additional Elements Styling
   -------------------------- */
/* Generic section backgrounds for hierarchy */
section:nth-of-type(odd) { background: #FFFFFF; }
section:nth-of-type(even) { background: #FBFDFF; }

/* FAQ blocks spacing */
.content-wrapper > div > h3 { margin-top: 8px; margin-bottom: 6px; }
.content-wrapper > div { display: flex; flex-direction: column; gap: 6px; }

/* Lists in footer/contacts */
.content-wrapper ul { margin: 0 0 8px; }

/* Ensure minimum spacing between content elements */
.content-wrapper > * { margin-top: 0; }

/* Prevent overlapping & provide breathing room */
section, .card, .testimonial-card, .feature-item { scroll-margin-top: 80px; }

/* --------------------------
   Forms (basic if ever added)
   -------------------------- */
input[type="text"], input[type="email"], input[type="tel"], textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
input:focus, textarea:focus { outline: 2px solid #A8C7E6; outline-offset: 2px; }

/* --------------------------
   Color Utilities for Status
   -------------------------- */
.bg-accent { background: var(--accent); }
.text-muted { color: var(--muted); }
.border { border: 1px solid var(--border); border-radius: 8px; }

/* --------------------------
   Print Styles (basic)
   -------------------------- */
@media print {
  .mobile-menu-toggle, .mobile-menu, .cookie-banner, .cookie-modal { display: none !important; }
  a { text-decoration: underline; }
}
