/* =========================================================
   ImmoKompass Deutschland – style.css
   Design style: soft_pastel (pastel colors, gentle, dreamy)
   Brand: primary #0D2B45, secondary #2E6F57, accent #F5F7FA
   Mobile-first, ONLY Flexbox, no CSS Grid or Columns
   ========================================================= */

/* ----------------------------
   CSS Reset / Normalize (light)
   ---------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }
svg { display: inline-block; vertical-align: middle; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0 0 16px 24px; padding: 0; }
li { margin-bottom: 8px; }
figure { margin: 0; }

/* ----------------------------
   Theme Variables (with fallbacks)
   ---------------------------- */
:root {
  --brand-primary: #0D2B45;
  --brand-secondary: #2E6F57;
  --brand-accent: #F5F7FA;
  /* Soft pastel palette */
  --pastel-sky: #EAF2FB;     /* soft sky */
  --pastel-mint: #E6F4F1;    /* mint */
  --pastel-lavender: #EFE7FB;/* lavender */
  --pastel-blush: #FDECEF;   /* blush */
  --pastel-peach: #FFF0E5;   /* peach */
  --text-dark: #1F2A37;
  --text-muted: #4B5563;
  --white: #FFFFFF;
  --shadow-soft: 0 6px 18px rgba(13,43,69,0.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --focus: #2E6F57;
}

/* ----------------------------
   Base Typography & Body
   ---------------------------- */
body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--brand-accent);
}

h1, h2, h3, h4 {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--brand-primary);
  margin: 0 0 16px 0;
}

h1 { font-size: 40px; line-height: 1.2; }
h2 { font-size: 28px; line-height: 1.3; }
h3 { font-size: 20px; line-height: 1.4; }

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

/* Accessibility: focus states */
:focus { outline: none; }
:focus-visible {
  outline: 2px dashed var(--focus);
  outline-offset: 3px;
}

/* ----------------------------
   Layout Containers (Flex only)
   ---------------------------- */
.container {
  display: flex;               /* Flex layout as required */
  justify-content: center;     /* center inner wrapper */
  width: 100%;
  padding: 0 16px;
}

.content-wrapper {
  display: flex;               /* Flex layout for stacking content */
  flex-direction: column;      /* mobile-first: column */
  gap: 16px;                   /* breathing space */
  width: 100%;
  max-width: 1080px;
  padding: 24px 0;
}

/* Section spacing (global) */
section { margin: 0 0 60px 0; }

/* MANDATORY SPACING AND ALIGNMENT PATTERNS (exact) */
.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; }

/* Ensure minimum spacing between stacked content blocks */
.content-wrapper > * + * { margin-top: 20px; }

/* ----------------------------
   Header & Navigation
   ---------------------------- */
header {
  background: var(--white);
  box-shadow: 0 8px 24px rgba(13,43,69,0.06);
  position: relative;
  z-index: 100;
}

header .content-wrapper {
  flex-direction: row;          /* header horizontal */
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.logo { display: flex; align-items: center; }
.logo img { height: 40px; width: auto; }

.main-nav {
  display: none;                /* hidden on mobile */
  align-items: center;
  gap: 16px;
}
.main-nav a {
  color: var(--brand-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
}
.main-nav a:hover { background: var(--pastel-sky); transform: translateY(-2px); }
.main-nav a:active { transform: translateY(0); }

.header-cta {
  display: none;                /* hidden on mobile */
  align-items: center;
  gap: 10px;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  background: var(--pastel-mint);
  border: 1px solid rgba(13,43,69,0.12);
  border-radius: 12px;
  color: var(--brand-primary);
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.2s ease;
}
.mobile-menu-toggle:hover { background: var(--pastel-sky); transform: translateY(-1px); }

/* Mobile Menu Overlay */
.mobile-menu {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 84%; max-width: 380px;
  background: var(--white);
  box-shadow: -12px 0 28px rgba(13,43,69,0.18);
  transform: translateX(100%);
  transition: transform 0.35s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 18px;
}
.mobile-menu.open { transform: translateX(0); }

.mobile-menu-close {
  align-self: flex-end;
  background: var(--pastel-blush);
  border: 1px solid rgba(13,43,69,0.12);
  color: var(--brand-primary);
  border-radius: 10px;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0;
}
.mobile-nav a {
  color: var(--brand-primary);
  padding: 12px 10px;
  border-radius: 10px;
  background: var(--pastel-sky);
  transition: background-color 0.25s ease, transform 0.2s ease;
}
.mobile-nav a:hover { background: var(--pastel-mint); transform: translateX(2px); }

/* ----------------------------
   Buttons
   ---------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease, background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.btn:active { transform: translateY(0); }

.btn.primary {
  background: var(--brand-secondary);
  color: var(--white);
  border-color: rgba(0,0,0,0.0);
}
.btn.primary:hover { background: #2B6A53; }

.btn.secondary {
  background: var(--pastel-lavender);
  color: var(--brand-primary);
  border-color: rgba(13,43,69,0.08);
}
.btn.secondary:hover { background: #E7DFFE; }

.btn.link {
  background: transparent;
  color: var(--brand-secondary);
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn.link:hover { color: #265B47; }

/* ----------------------------
   Hero Sections
   ---------------------------- */
.hero {
  background: var(--pastel-sky);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}
.hero p { color: var(--text-muted); }

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.trust-badges ul, .supporting-points {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 10px;
}
.trust-badges li, .supporting-points li {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--pastel-mint);
  border: 1px solid rgba(13,43,69,0.08);
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--brand-primary);
}
.trust-badges img, .text-section img { width: 18px; height: 18px; }

/* ----------------------------
   Content Blocks & Cards
   ---------------------------- */
.text-section { color: var(--text-dark); }
.text-section a { color: var(--brand-secondary); }
.text-section p img { margin-right: 8px; vertical-align: middle; }

.card {
  background: var(--white);
  border: 1px solid rgba(13,43,69,0.08);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 20px;
}
.card-content { display: flex; flex-direction: column; justify-content: center; gap: 10px; }

.listing-item {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--pastel-peach);
  border: 1px solid rgba(13,43,69,0.08);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

/* Testimonials: light background, dark text for contrast */
.testimonial-card {
  background: var(--white);
  border: 1px solid rgba(13,43,69,0.10);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  color: var(--text-dark);
}
.testimonial-card p { margin: 0; }

/* Footer */
footer {
  background: var(--pastel-mint);
  border-top: 1px solid rgba(13,43,69,0.08);
}
footer .content-wrapper { gap: 16px; }
footer nav, footer .legal-links {
  display: flex; flex-wrap: wrap; gap: 12px;
}
footer a { color: var(--brand-primary); }
.footer-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.legal-links a { padding: 6px 10px; border-radius: 8px; }
.legal-links a:hover { background: var(--pastel-sky); }

/* Contact snippets */
.contact-snippet { color: var(--text-muted); }
.contact-snippet a { color: var(--brand-secondary); }

/* Lists & Content spacing */
ul li { color: var(--text-dark); }
ol { margin-left: 24px; }

/* Images inside text */
.text-section p img { display: inline-block; }

/* Privacy note emphasis */
.privacy-note { font-size: 14px; color: var(--text-muted); }
.privacy-note a { color: var(--brand-secondary); text-decoration: underline; }

/* ----------------------------
   Cookie Consent Banner & Modal
   ---------------------------- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;              /* flex container */
  justify-content: center;
  z-index: 1200;
  padding: 12px;
  transform: translateY(0);
  transition: transform 0.35s ease;
}
.cookie-banner.hidden { transform: translateY(100%); }

.cookie-banner .cookie-inner {
  display: flex; flex-direction: column; gap: 12px;
  width: 100%; max-width: 980px;
  background: var(--white);
  border: 1px solid rgba(13,43,69,0.10);
  box-shadow: 0 18px 36px rgba(13,43,69,0.18);
  border-radius: 16px;
  padding: 16px;
}
.cookie-banner p { margin: 0; color: var(--text-dark); }
.cookie-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-buttons .btn { padding: 10px 14px; }
.cookie-buttons .btn.reject { background: var(--pastel-blush); color: var(--brand-primary); border-color: rgba(13,43,69,0.06); }
.cookie-buttons .btn.settings { background: var(--pastel-sky); color: var(--brand-primary); }

/* Cookie Modal */
.cookie-modal {
  position: fixed; inset: 0;
  background: rgba(13,43,69,0.35);
  display: none;              /* toggled via class */
  align-items: center; justify-content: center;
  z-index: 1300;
}
.cookie-modal.open { display: flex; }
.cookie-modal-content {
  background: var(--white);
  width: 92%; max-width: 720px;
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(13,43,69,0.25);
  padding: 18px;
  display: flex; flex-direction: column; gap: 16px;
}
.cookie-categories { display: flex; flex-direction: column; gap: 12px; }
.cookie-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px dashed rgba(13,43,69,0.12); }
.cookie-row:last-child { border-bottom: none; }

/* Simple toggle switch */
.toggle {
  display: inline-flex; align-items: center; gap: 8px;
}
.toggle input[type="checkbox"] { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: #E2E8F0; position: relative; outline: none; transition: background-color 0.25s ease; }
.toggle input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: var(--white); border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,0.15); transition: transform 0.25s ease; }
.toggle input[type="checkbox"]:checked { background: var(--brand-secondary); }
.toggle input[type="checkbox"]:checked::after { transform: translateX(18px); }

/* ----------------------------
   Micro-interactions
   ---------------------------- */
a { color: var(--brand-primary); transition: color 0.2s ease; }
a:hover { color: #123A5F; }

/* Elevation on hover for cards */
.card:hover, .listing-item:hover, .testimonial-card:hover { box-shadow: 0 10px 28px rgba(13,43,69,0.14); transform: translateY(-2px); transition: transform 0.2s ease, box-shadow 0.25s ease; }

/* ----------------------------
   Responsive Rules (Mobile-first)
   ---------------------------- */
/* Text-image section: column on mobile, row on desktop (also enforced below) */
@media (max-width: 768px) {
  .text-image-section { flex-direction: column; }
}

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

  .hero { padding-top: 10px; }

  /* Create horizontal alignment where helpful */
  .content-grid { justify-content: flex-start; }
}

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

  /* Larger spacing */
  .content-wrapper { gap: 20px; padding: 28px 0; }

  /* Text-image sections side-by-side */
  .text-image-section { flex-direction: row; align-items: center; }

  /* Distribute items within content grids nicely */
  .content-grid { justify-content: space-between; }
}

/* ----------------------------
   Utility Helpers
   ---------------------------- */
.hide { display: none !important; }
.center { text-align: center; }

/* ----------------------------
   Page-specific subtle accents
   ---------------------------- */
/* Use alternating soft backgrounds for various sections to create a dreamy rhythm */
section:nth-of-type(2n) .content-wrapper { background: var(--pastel-peach); border-radius: 16px; padding: 24px; border: 1px solid rgba(13,43,69,0.06); }
section:nth-of-type(3n) .content-wrapper { background: var(--pastel-lavender); border-radius: 16px; padding: 24px; border: 1px solid rgba(13,43,69,0.06); }
/* Keep hero distinct */
.hero .content-wrapper { background: transparent; padding: 24px 0; }

/* ----------------------------
   Forms (if any appear later)
   ---------------------------- */
input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(13,43,69,0.18);
  background: var(--white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--brand-secondary);
  box-shadow: 0 0 0 3px rgba(46,111,87,0.15);
}

/* ----------------------------
   Header/Footer link sizing for touch
   ---------------------------- */
header a, footer a { line-height: 1.4; }

/* ----------------------------
   Ensure adequate gaps in complex lists (FAQs)
   ---------------------------- */
.text-section h3 { margin-top: 12px; margin-bottom: 6px; }
.text-section p + h3 { margin-top: 16px; }

/* ----------------------------
   Extra: Wrap long content gracefully
   ---------------------------- */
.content-wrapper { word-break: normal; overflow-wrap: anywhere; }

/* ----------------------------
   Compliance with Flex-only requirement
   (All layout containers above use flex; no grid or columns used.)
   ---------------------------- */
