/* =============================================================
   Emerald Routes Rentenberatung – Industrial Modern Theme
   Style.css – Mobile-first, Flexbox-only, High Contrast, Brand-aware
   ============================================================= */

/* ------------------------------
   RESET & BASE NORMALIZE
------------------------------ */
* { box-sizing: border-box; }
*::before, *::after { box-sizing: inherit; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding: 0; }
img, svg { max-width: 100%; height: auto; display: block; }
picture { display: block; }
ul, ol { margin: 0; padding-left: 20px; }
h1, h2, h3, h4, h5, h6, p { margin: 0 0 16px 0; }
a { color: inherit; text-decoration: none; }
button { background: none; border: none; font: inherit; color: inherit; padding: 0; cursor: pointer; }
:focus { outline: 2px solid #9AA4AD; outline-offset: 2px; }

/* ------------------------------
   DESIGN TOKENS
------------------------------ */
:root {
  /* Brand */
  --brand-primary: #0B5F4A; /* Emerald */
  --brand-secondary: #2E4057; /* Deep slate-blue */
  --brand-accent: #F4F7F5; /* Light accent */

  /* Industrial Modern Palette */
  --bg: #0F1214;               /* Charcoal */
  --surface: #1A1F24;          /* Dark steel */
  --surface-2: #222830;        /* Graphite */
  --metal: #9AA4AD;            /* Brushed metal */
  --edge: #3C444C;             /* Edges/borders */
  --text: #E9EFEA;             /* Main text (light) */
  --text-muted: #B9C2BB;       /* Muted text */
  --warning: #D97706;
  --success: #198754;
  --danger: #B00020;

  /* Shadows & Radius */
  --radius-s: 6px;
  --radius-m: 10px;
  --shadow-1: 0 6px 14px rgba(0,0,0,0.3);
  --shadow-2: 0 10px 24px rgba(0,0,0,0.35);

  /* Type scale */
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-24: 24px;
  --fs-32: 32px;
  --fs-48: 48px;
}

/* ------------------------------
   GLOBAL TYPOGRAPHY
------------------------------ */
body {
  font-family: Verdana, Geneva, Tahoma, sans-serif; /* brand body */
  font-size: var(--fs-16);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, h4 {
  font-family: Georgia, 'Times New Roman', serif; /* brand display */
  letter-spacing: 0.2px;
  color: var(--brand-accent);
}

h1 { font-size: 34px; line-height: 1.2; }
h2 { font-size: 26px; line-height: 1.3; margin-bottom: 16px; }
h3 { font-size: 20px; line-height: 1.35; margin-top: 8px; }
h4 { font-size: 18px; line-height: 1.4; }

@media (min-width: 768px) {
  h1 { font-size: var(--fs-48); }
  h2 { font-size: var(--fs-32); }
  h3 { font-size: var(--fs-24); }
}

p { color: var(--text); }
.small, small { font-size: var(--fs-14); color: var(--text-muted); }
strong { color: var(--brand-accent); }

/* Link styles */
a { color: var(--brand-primary); transition: color 0.2s ease, opacity 0.2s ease; }

a:active { opacity: 0.85; }

/* Selection */
::selection { background: var(--brand-primary); color: #fff; }

/* ------------------------------
   LAYOUT WRAPPERS – FLEX ONLY
------------------------------ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;              /* Flexbox for layout container */
  flex-direction: column;     /* Mobile-first column */
  gap: 20px;
}

.content-wrapper {
  display: flex;              /* Flex layout */
  flex-direction: column;     /* Column on mobile */
  gap: 20px;                  /* breathing room */
}

main { display: flex; flex-direction: column; gap: 20px; }
section { display: flex; flex-direction: column; }

/* Mandatory spacing pattern – included exactly */
.section { margin-bottom: 60px; padding: 40px 20px; display: flex; flex-direction: column; gap: 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; display: flex; flex-direction: column; }
.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 & NAVIGATION
------------------------------ */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--edge);
  position: sticky;
  top: 0;
  z-index: 900;
}

header > .container { flex-direction: row; align-items: center; justify-content: space-between; padding-top: 12px; padding-bottom: 12px; }

.logo { display: flex; align-items: center; }
.logo img { height: 38px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25)); }

.main-nav {
  display: none; /* Hidden on mobile */
  align-items: center;
  gap: 14px;
}

.main-nav a {
  color: var(--text);
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.main-nav a:hover { background: var(--surface-2); border-color: var(--edge); }
.main-nav a:active { transform: translateY(1px); }

/* CTA links inside nav */
.main-nav .cta-primary { background: var(--brand-primary); color: #fff; border-color: #0a5643; }
.main-nav .cta-primary:hover { background: #0d7a60; border-color: #0d7a60; }
.main-nav .cta-secondary { background: transparent; color: var(--brand-accent); border-color: var(--metal); }
.main-nav .cta-secondary:hover { background: var(--surface-2); }

/* Mobile hamburger */
.mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  color: var(--brand-accent);
  border: 1px solid var(--edge);
  border-radius: var(--radius-s);
  background: var(--surface-2);
  transition: background 0.2s ease, transform 0.15s ease;
}
.mobile-menu-toggle:hover { background: #2a323b; }
.mobile-menu-toggle:active { transform: scale(0.98); }

/* Desktop breakpoint */
@media (min-width: 992px) {
  .main-nav { display: flex; }
  .mobile-menu-toggle { display: none; }
}

/* ------------------------------
   MOBILE MENU OVERLAY
------------------------------ */
.mobile-menu {
  position: fixed;
  inset: 0;
  display: flex;                /* Flex overlay */
  align-items: stretch;
  justify-content: flex-end;
  background: rgba(10, 12, 14, 0.7);
  backdrop-filter: blur(2px);
  transform: translateX(100%);
  transition: transform 0.35s ease;
  z-index: 1000;
}
/* Allow multiple activation class names */
.mobile-menu.open,
.mobile-menu.active,
.mobile-menu.is-open { transform: translateX(0); }

.mobile-nav {
  display: flex;                /* Flex side panel */
  flex-direction: column;
  gap: 8px;
  width: 85%;
  max-width: 360px;
  background: var(--surface);
  border-left: 1px solid var(--edge);
  padding: 24px;
  box-shadow: var(--shadow-2);
}

.mobile-nav a {
  display: flex;
  align-items: center;
  padding: 12px 10px;
  color: var(--brand-accent);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.mobile-nav a:hover { background: var(--surface-2); border-color: var(--edge); }

.mobile-menu-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--brand-accent);
  background: var(--surface-2);
  border: 1px solid var(--edge);
  border-radius: var(--radius-s);
}

/* ------------------------------
   HERO SECTIONS
------------------------------ */
.hero {
  background: var(--surface-2);
  border-bottom: 1px solid var(--edge);
}
.hero .container { padding-top: 36px; padding-bottom: 36px; }
.hero .content-wrapper { gap: 16px; }
.hero p { color: var(--text-muted); }

.actions {
  display: flex; flex-direction: column; gap: 12px; flex-wrap: wrap; align-items: flex-start;
}
@media (min-width: 768px) {
  .actions { flex-direction: row; }
}

/* Trust badges list */
.trust-badges ul {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center;
  list-style: none; padding: 0; margin: 0;
}
.trust-badges li {
  color: var(--text);
  background: #14181d;
  border: 1px solid var(--edge);
  border-left: 4px solid var(--brand-primary);
  padding: 8px 12px;
  border-radius: var(--radius-s);
}

/* ------------------------------
   SECTIONS & TEXT BLOCKS
------------------------------ */
section:not(.hero) { border-top: 1px solid var(--edge); background: var(--surface); }
section:not(.hero) .container { padding-top: 28px; padding-bottom: 28px; }

.text-section {
  display: flex; flex-direction: column; gap: 8px; /* ensures spacing */
  background: #14181D;
  border: 1px solid var(--edge);
  border-left: 4px solid var(--brand-secondary);
  padding: 16px;
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-1);
}

.text-section ul, .text-section ol { padding-left: 20px; }
.text-section li { margin-bottom: 8px; color: var(--text); }
.text-section h3 { color: var(--brand-accent); }

/* Content utilities */
.content-grid { justify-content: space-between; }

/* ------------------------------
   CARDS & TESTIMONIALS
------------------------------ */
.card {
  background: #14181D;
  border: 1px solid var(--edge);
  border-radius: var(--radius-m);
  padding: 16px;
  box-shadow: var(--shadow-1);
}
.card:hover { border-color: var(--metal); }

/* Testimonial: light background with dark text for readability */
.testimonial-card {
  background: var(--brand-accent);
  color: #1a2329; /* dark text on light */
  border: 1px solid #D6DFDA;
  border-left: 6px solid var(--brand-primary);
  border-radius: var(--radius-m);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  margin-bottom: 20px; /* ensure spacing between cards */
}
.testimonial-card p { color: #1a2329; }
.testimonial-card strong { color: #102026; }

/* ------------------------------
   BUTTONS & INTERACTIONS
------------------------------ */
.cta-primary,
button.cta-primary,
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--brand-primary);
  color: #fff;
  border: 1px solid #0a5643;
  border-radius: var(--radius-m);
  box-shadow: 0 8px 18px rgba(11,95,74,0.25);
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.cta-primary:hover { background: #0d7a60; box-shadow: 0 10px 22px rgba(13,122,96,0.28); }
.cta-primary:active { transform: translateY(1px); }

.cta-secondary,
button.cta-secondary,
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  background: transparent;
  color: var(--brand-accent);
  border: 1px solid var(--metal);
  border-radius: var(--radius-m);
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}
.cta-secondary:hover { background: var(--surface-2); border-color: var(--edge); }
.cta-secondary:active { transform: translateY(1px); }

/* Generic button class */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; border-radius: var(--radius-s); border: 1px solid var(--edge); background: var(--surface-2); color: var(--text); }
.btn:hover { border-color: var(--metal); }

/* ------------------------------
   FOOTER
------------------------------ */
footer { background: #0F1214; border-top: 1px solid var(--edge); }
footer .content-wrapper { display: flex; flex-direction: column; gap: 20px; }
footer .text-section { background: transparent; border: 1px dashed var(--edge); border-left-color: var(--brand-primary); }

.footer-nav, .footer-legal {
  display: flex; flex-direction: column; gap: 8px;
}
.footer-nav ul, .footer-legal ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-nav a, .footer-legal a { color: var(--text-muted); }
.footer-nav a:hover, .footer-legal a:hover { color: var(--brand-accent); }

@media (min-width: 768px) {
  footer .content-wrapper { flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
  .footer-nav, .footer-legal { width: 280px; }
}

/* ------------------------------
   RESPONSIVE ALIGNMENT RULES
------------------------------ */
.text-image-section { align-items: center; }
@media (max-width: 768px) {
  .text-image-section { flex-direction: column; }
}

/* ------------------------------
   COOKIE CONSENT BANNER & MODAL
------------------------------ */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; gap: 12px; align-items: stretch;
  background: var(--surface);
  color: var(--text);
  border-top: 2px solid var(--brand-primary);
  padding: 16px 16px 16px 16px;
  box-shadow: 0 -10px 24px rgba(0,0,0,0.35);
  z-index: 1100;
  transform: translateY(100%);
  transition: transform 0.35s ease;
}
.cookie-banner.open,
.cookie-banner.is-open,
.cookie-banner.active { transform: translateY(0); }

.cookie-banner .cookie-content { display: flex; flex-direction: column; gap: 12px; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.cookie-actions .btn { border-color: var(--metal); background: var(--surface-2); color: var(--brand-accent); }
.cookie-actions .btn-accept { background: var(--brand-primary); color: #fff; border-color: #0a5643; }
.cookie-actions .btn-accept:hover { background: #0d7a60; }
.cookie-actions .btn-reject { background: transparent; color: var(--brand-accent); border-color: var(--metal); }
.cookie-actions .btn-settings { background: #161B20; color: var(--brand-accent); }

/* Cookie preferences modal */
.cookie-modal {
  position: fixed; inset: 0; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(10,12,14,0.65); backdrop-filter: blur(2px);
  z-index: 1200; transform: translateY(100%); transition: transform 0.35s ease;
}
.cookie-modal.open,
.cookie-modal.is-open,
.cookie-modal.active { transform: translateY(0); }

.cookie-modal .modal-panel {
  width: 100%; max-width: 720px;
  background: var(--surface);
  border-top: 2px solid var(--brand-secondary);
  border-left: 1px solid var(--edge); border-right: 1px solid var(--edge);
  border-radius: var(--radius-m) var(--radius-m) 0 0;
  box-shadow: var(--shadow-2);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.cookie-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; border: 1px solid var(--edge); background: #14181D; padding: 12px; border-radius: var(--radius-s); }
.cookie-row .label { color: var(--brand-accent); }

/* Toggle switch */
.toggle { appearance: none; -webkit-appearance: none; width: 44px; height: 24px; border-radius: 12px; background: #6b7680; position: relative; outline: none; border: 1px solid var(--edge); transition: background 0.2s ease; }
.toggle::after { content: ""; position: absolute; top: 50%; left: 2px; transform: translateY(-50%); width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left 0.2s ease; }
.toggle:checked { background: var(--brand-primary); }
.toggle:checked::after { left: 24px; }

/* Essential cookies (locked) */
.toggle[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ------------------------------
   UTILITIES
------------------------------ */
.hidden { display: none !important; }
.muted { color: var(--text-muted) !important; }
.hr { height: 1px; width: 100%; background: var(--edge); opacity: 0.6; }

/* Spacing helpers (8/16/24/32) */
.mt-16 { margin-top: 16px; } .mb-16 { margin-bottom: 16px; }
.mt-24 { margin-top: 24px; } .mb-24 { margin-bottom: 24px; }
.mt-32 { margin-top: 32px; } .mb-32 { margin-bottom: 32px; }

/* ------------------------------
   PAGE-SPECIFIC ENHANCEMENTS
------------------------------ */
/* Index: make first non-hero sections breathe */
main > section + section .content-wrapper { gap: 16px; }

/* Phone/mail/location icon alignment inside lists */
.text-section li img { width: 18px; height: 18px; margin-right: 8px; display: inline-block; vertical-align: text-bottom; filter: grayscale(100%) brightness(1.2); }

/* Ordered lists styling */
ol { counter-reset: item; }
ol > li { position: relative; padding-left: 6px; }

/* ------------------------------
   FLEX RESPONSIVE ENHANCEMENTS
------------------------------ */
@media (min-width: 768px) {
  .content-wrapper { flex-direction: row; flex-wrap: wrap; }
  .text-section { flex: 1 1 48%; }
  .text-section.wide { flex: 1 1 100%; }
}

@media (min-width: 1024px) {
  .content-wrapper { gap: 24px; }
}

/* ------------------------------
   ACCESSIBILITY & STATES
------------------------------ */
[aria-hidden="true"] { visibility: hidden; }
:focus-visible { outline: 2px solid var(--brand-secondary); outline-offset: 2px; }

/* ------------------------------
   ENSURE MINIMUM GAPS BETWEEN CARDS/SECTIONS
------------------------------ */
section + section { margin-top: 20px; }
.text-section + .text-section,
.card + .card,
.testimonial-card + .testimonial-card { margin-top: 20px; }

/* ------------------------------
   PRINT FRIENDLY
------------------------------ */
@media print {
  header, footer, .mobile-menu, .cookie-banner, .cookie-modal { display: none !important; }
  body { background: #fff; color: #000; }
  .text-section, .card { border-color: #ccc; background: #fff; box-shadow: none; }
}

/* ------------------------------
   COMPLIANCE CHECK HELPERS (NO GRID/COLUMNS USED)
------------------------------ */
/* Intentionally not using CSS Grid or Columns. Flexbox-only layouts throughout. */
