/* =============================================================
   WohnKauf Kompass - Vibrant Energetic CSS (Flexbox-only)
   Author: Senior CSS Dev & UI Designer
   Requirements:
   - Mobile-first, flexbox layouts only (NO grid/columns)
   - Vibrant energetic feel with brand palette and electric accents
   - Strong hierarchy, spacing, hover effects, mobile menu, cookie banner
   ============================================================= */

/* -------------------------
   Reset & Base Normalize
------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
img, picture { max-width: 100%; display: block; height: auto; }
svg { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding-left: 20px; }
figure { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus { outline: none; }
:focus-visible { outline: 3px solid #00D1FF; outline-offset: 2px; }

/* -------------------------
   Design Tokens (CSS Vars)
------------------------- */
:root {
  --color-primary: #123A6F; /* brand navy */
  --color-secondary: #2E7D6E; /* brand teal */
  --color-accent: #F5F8FC; /* brand soft */
  --color-ink: #0B2540; /* deep text */
  --color-muted: #6B7A90; /* muted text */
  --color-white: #FFFFFF;
  /* Vibrant energetic accents */
  --electric-pink: #FF2D55;
  --electric-cyan: #00D1FF;
  --electric-yellow: #FFD400;
  --surface: #FFFFFF;
  --shadow: 0 10px 24px rgba(18,58,111,0.12), 0 2px 6px rgba(18,58,111,0.08);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;
}

/* -------------------------
   Typography
------------------------- */
body {
  font-family: Arial, Helvetica, sans-serif; /* brand body */
  color: var(--color-ink);
  background: var(--color-white);
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; /* brand display */
  margin: 0 0 12px;
  color: var(--color-ink);
  letter-spacing: 0.2px;
}

h1 { font-size: 32px; line-height: 1.2; }
h2 { font-size: 24px; line-height: 1.25; margin-top: 8px; }
h3 { font-size: 18px; line-height: 1.3; }

p { margin: 0 0 12px; color: var(--color-ink); }
small, .kicker { font-size: 14px; }

.subheadline { color: var(--color-muted); font-size: 18px; line-height: 1.5; }
.kicker { text-transform: uppercase; letter-spacing: 1px; font-weight: 700; color: var(--color-primary); display: inline-flex; align-items: center; gap: 8px; background: var(--color-accent); padding: 6px 12px; border-radius: var(--radius-pill); border: 2px solid var(--electric-yellow); }

/* Links */
a { color: var(--color-primary); text-decoration: underline; text-decoration-color: rgba(0,209,255,0.35); text-underline-offset: 3px; transition: color 0.2s ease, text-decoration-color 0.2s ease; }
a:hover { color: var(--electric-pink); text-decoration-color: var(--electric-pink); }

/* Lists */
ul li, ol li { margin-bottom: 8px; }
.text-section ul { list-style: none; padding-left: 0; }
.text-section ul li { position: relative; padding-left: 26px; }
.text-section ul li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--electric-cyan); position: absolute; left: 0; top: 9px; }
.text-section ol { padding-left: 22px; }

.disclaimer, .privacy-note { font-size: 14px; color: var(--color-muted); }

/* -------------------------
   Layout Helpers
------------------------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; flex-direction: column; gap: 20px; }
.content-wrapper { display: flex; flex-direction: column; gap: 18px; }
.section { margin-bottom: 60px; padding: 40px 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; background: var(--surface); border: 1px solid #E7ECF4; border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 20px; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(18,58,111,0.16), 0 4px 10px rgba(18,58,111,0.1); }
.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; background: var(--color-white); border: 1px solid #E6EBF2; border-left: 6px solid var(--electric-yellow); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Prevent overlap spacing */
section { margin-bottom: 56px; }
section .content-wrapper > * + * { margin-top: 4px; }

/* -------------------------
   Header & Navigation
------------------------- */
header { position: sticky; top: 0; z-index: 1000; background: var(--color-white); box-shadow: 0 6px 16px rgba(18,58,111,0.08); }
header .container { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.logo img { height: 40px; width: auto; }

.main-nav { display: none; align-items: center; gap: 14px; }
.main-nav a { color: var(--color-ink); font-weight: 600; padding: 8px 10px; border-radius: var(--radius-pill); text-decoration: none; transition: background 0.2s ease, color 0.2s ease; }
.main-nav a[aria-current="page"] { color: var(--color-primary); background: var(--color-accent); }
.main-nav a:hover { background: rgba(0,209,255,0.12); color: var(--electric-pink); }

.header-cta { display: flex; align-items: center; gap: 10px; }

.mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--color-primary); color: #fff; font-size: 20px; box-shadow: var(--shadow); }
.mobile-menu-toggle:hover { background: var(--electric-pink); }

/* Mobile Menu Overlay */
.mobile-menu { position: fixed; inset: 0; background: var(--color-white); transform: translateX(100%); transition: transform 0.35s ease; z-index: 2000; opacity: 0; pointer-events: none; display: flex; flex-direction: column; }
.mobile-menu.active { transform: translateX(0); opacity: 1; pointer-events: auto; }
.mobile-menu-close { align-self: flex-end; margin: 16px; width: 44px; height: 44px; border-radius: 12px; background: var(--color-accent); color: var(--color-ink); font-size: 20px; }
.mobile-nav { display: flex; flex-direction: column; gap: 10px; padding: 10px 20px 40px; }
.mobile-nav a { display: flex; align-items: center; justify-content: flex-start; min-height: 48px; border-radius: 12px; padding: 12px 14px; font-weight: 700; color: var(--color-ink); background: #fff; border: 1px solid #E6EBF2; }
.mobile-nav a:hover { background: var(--color-accent); color: var(--electric-pink); }
.mobile-nav a[aria-current="page"] { border-color: var(--electric-cyan); box-shadow: inset 0 0 0 2px var(--electric-cyan); }

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

/* -------------------------
   Hero Section (Vibrant Energetic)
------------------------- */
.hero { position: relative; background: var(--color-accent); overflow: hidden; }
.hero::before { content: ""; position: absolute; right: -20%; top: -40px; width: 70%; height: 200%; background: var(--electric-cyan); opacity: 0.12; transform: rotate(-12deg); z-index: 0; }
.hero::after { content: ""; position: absolute; left: -30%; bottom: -50px; width: 60%; height: 160%; background: var(--electric-pink); opacity: 0.08; transform: rotate(10deg); z-index: 0; }
.hero .container, .hero .content-wrapper { position: relative; z-index: 1; }
.hero .content-wrapper { align-items: flex-start; gap: 16px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.trust { display: flex; flex-direction: column; gap: 16px; }
.trust .text-section, .trust .key-stats { background: var(--surface); border: 1px solid #E6EBF2; border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow); }
.trust .key-stats ul { list-style: none; padding-left: 0; display: flex; flex-wrap: wrap; gap: 12px 20px; }
.trust .key-stats li strong { color: var(--color-primary); font-size: 18px; }

.rating-summary { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--color-accent); border: 1px dashed var(--electric-cyan); border-radius: var(--radius-pill); padding: 10px 14px; color: var(--color-ink); font-weight: 600; }

/* -------------------------
   Buttons
------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: var(--radius-pill); padding: 12px 18px; font-weight: 800; letter-spacing: 0.3px; text-decoration: none; transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.08s ease; border: 2px solid transparent; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--color-primary); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--electric-pink); box-shadow: 0 12px 22px rgba(255,45,85,0.25); }

.btn-secondary { background: var(--color-white); color: var(--color-primary); border-color: var(--color-primary); }
.btn-secondary:hover { color: #fff; background: var(--color-secondary); border-color: var(--color-secondary); box-shadow: 0 10px 20px rgba(46,125,110,0.25); }

.btn-link { background: transparent; color: var(--electric-pink); padding-left: 0; padding-right: 0; border: 0; text-decoration: underline; text-underline-offset: 4px; font-weight: 700; }
.btn-link:hover { color: var(--color-primary); text-decoration-color: var(--color-primary); }

/* -------------------------
   Content Blocks
------------------------- */
.text-section { display: flex; flex-direction: column; gap: 12px; }
.checklist-preview { display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid #E6EBF2; border-left: 6px solid var(--electric-cyan); border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow); }

/* Testimonials - contrast on light backgrounds */
.testimonial-card p { margin: 0; color: var(--color-ink); }
.testimonial-card p + p { color: var(--color-ink); opacity: 0.9; }

/* Footer */
footer { background: var(--color-primary); color: #EAF2FF; padding: 32px 0; }
footer a { color: #EAF2FF; text-decoration: none; }
footer a:hover { color: var(--electric-cyan); }
footer .container { gap: 20px; }
footer .content-wrapper { display: flex; flex-direction: column; gap: 20px; }
.footer-navigation, .legal-links, .contact-block, .brand-signature { display: flex; flex-direction: column; gap: 10px; }
.footer-navigation nav, .legal-links nav { display: flex; flex-direction: column; gap: 8px; }

/* -------------------------
   Cookie Consent Banner & Modal
------------------------- */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3000; background: #ffffff; border-top: 3px solid var(--electric-cyan); box-shadow: 0 -10px 24px rgba(18,58,111,0.12); display: none; }
.cookie-banner.show { display: flex; }
.cookie-banner .cookie-inner { max-width: 1200px; margin: 0 auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.cookie-banner p { margin: 0; color: var(--color-ink); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-actions .btn { padding: 10px 14px; }
.cookie-actions .btn-accept { background: var(--electric-pink); color: #fff; }
.cookie-actions .btn-accept:hover { background: #e11943; }
.cookie-actions .btn-reject { background: var(--color-white); color: var(--color-ink); border: 2px solid var(--color-ink); }
.cookie-actions .btn-settings { background: var(--color-accent); color: var(--color-ink); border: 2px solid var(--electric-cyan); }

/* Cookie Modal */
.cookie-overlay { position: fixed; inset: 0; background: rgba(11,37,64,0.6); z-index: 3100; display: none; align-items: center; justify-content: center; padding: 20px; }
.cookie-overlay.show { display: flex; }
.cookie-modal { width: 100%; max-width: 720px; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid #E6EBF2; display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.cookie-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cookie-modal-body { display: flex; flex-direction: column; gap: 14px; }
.cookie-category { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid #E6EBF2; border-radius: 12px; }
.cookie-category .label { font-weight: 700; color: var(--color-ink); }

/* Toggle Switch */
.switch { position: relative; width: 52px; height: 30px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; }
.switch .track { position: absolute; inset: 0; background: #E6EBF2; border-radius: 999px; transition: background 0.2s ease; }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.15); transition: transform 0.2s ease; }
.switch input:checked + .track { background: var(--electric-cyan); }
.switch input:checked + .track + .thumb { transform: translateX(22px); }
.switch input:disabled + .track { background: #cfd8e6; }

/* -------------------------
   Accessibility helpers
------------------------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }

/* -------------------------
   Utilities & Micro-interactions
------------------------- */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; background: var(--electric-yellow); color: #111; border-radius: var(--radius-pill); font-weight: 800; font-size: 12px; }
.shadow { box-shadow: var(--shadow); }
.bordered { border: 1px solid #E6EBF2; border-radius: var(--radius-md); }

/* Hover underline grow for links in nav/footers */
.main-nav a, footer a { position: relative; }
.main-nav a::after, footer a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 0.2s ease; opacity: 0.6; }
.main-nav a:hover::after, footer a:hover::after { transform: scaleX(1); }

/* -------------------------
   Page Specific Tweaks
------------------------- */
/* Emphasize hero titles */
.hero h1 { font-size: 28px; }
@media (min-width: 768px) { .hero h1 { font-size: 36px; } }
@media (min-width: 1200px) { .hero h1 { font-size: 44px; } }

/* Space between repeated testimonial cards */
.testimonial-card + .testimonial-card { margin-top: 16px; }

/* Buttons row wrap spacing */
.cta-row .btn { min-height: 44px; }

/* Key lists inside content */
.content-wrapper h2 { position: relative; padding-left: 14px; }
.content-wrapper h2::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 18px; background: var(--electric-pink); border-radius: 6px; }

/* Rating text */
.rating-summary, .content-wrapper > p { font-size: 16px; }

/* --------------
   Forms (future)
---------------- */
input[type="text"], input[type="email"], input[type="tel"], textarea { width: 100%; padding: 12px 14px; border: 1px solid #CDD9EA; border-radius: 12px; background: #fff; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
input:focus, textarea:focus { border-color: var(--electric-cyan); box-shadow: 0 0 0 3px rgba(0,209,255,0.2); }
label { font-weight: 700; margin-bottom: 6px; display: inline-flex; }

/* -------------------------
   Responsive Layout Rules
------------------------- */
/* Mobile-first: column stacks already default */

/* Tablet */
@media (min-width: 768px) {
  .trust { flex-direction: row; }
  .trust .text-section, .trust .key-stats { flex: 1 1 0; }
  .footer-navigation nav, .legal-links nav { flex-direction: row; flex-wrap: wrap; gap: 10px 16px; }
}

/* Desktop */
@media (min-width: 992px) {
  header .container { gap: 16px; }
  .content-wrapper { gap: 20px; }
  .hero .content-wrapper { align-items: flex-start; max-width: 900px; }
  footer .content-wrapper { flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
  .footer-navigation, .legal-links, .contact-block { flex: 1 1 240px; }
  .brand-signature { flex: 1 1 100%; }
}

/* -------------------------
   Additional Flex Patterns (as required)
------------------------- */
/* Already included exact required classes above. Ensuring spacing and alignment: */
.card-content { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.features { display: flex; flex-wrap: wrap; gap: 20px; }
.card-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }

/* -------------------------
   Header/Section spacing polish
------------------------- */
main { display: flex; flex-direction: column; gap: 30px; }
.hero .container { padding-top: 32px; padding-bottom: 32px; }
@media (min-width: 992px) { .hero .container { padding-top: 48px; padding-bottom: 48px; } }

/* -------------------------
   High-contrast elements where needed
------------------------- */
/* Testimonials: enforce dark text on light backgrounds */
section .testimonial-card, .testimonial-card * { color: var(--color-ink); }

/* -------------------------
   Tables (fallback basic styles)
------------------------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid #E6EBF2; padding: 10px; }
th { color: var(--color-ink); font-weight: 800; }

/* -------------------------
   Print-safe adjustments (minimal)
------------------------- */
@media print {
  .mobile-menu-toggle, .header-cta, .mobile-menu, .cookie-banner, .cookie-overlay { display: none !important; }
  header { position: static; box-shadow: none; }
}

/* -------------------------
   Small Animations
------------------------- */
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.hero .content-wrapper > * { animation: slideUp 0.4s ease both; }
.hero .content-wrapper > *:nth-child(2) { animation-delay: 0.06s; }
.hero .content-wrapper > *:nth-child(3) { animation-delay: 0.12s; }
.hero .content-wrapper > *:nth-child(4) { animation-delay: 0.18s; }
.cookie-banner.show { animation: slideUp 0.25s ease both; }
.cookie-overlay.show { animation: fadeIn 0.2s ease both; }

/* -------------------------
   Ensure adequate gaps between all elements to prevent overlap
------------------------- */
section > .container { gap: 18px; }
section > .container > .content-wrapper > * { margin-bottom: 4px; }

/* -------------------------
   Page Header alignment with flex
------------------------- */
header .container > .logo { flex: 0 0 auto; }
header .container > .main-nav { flex: 1 1 auto; justify-content: center; }
header .container > .header-cta { flex: 0 0 auto; }

/* -------------------------
   Active link state across site
------------------------- */
nav a[aria-current="page"], .mobile-nav a[aria-current="page"] { font-weight: 800; }

/* -------------------------
   Specific text accents for vibrant energy
------------------------- */
strong { color: var(--color-ink); }
mark { background: var(--electric-yellow); color: #111; padding: 0 4px; border-radius: 4px; }

/* -------------------------
   Compliance with mandatory spacing rules (redundant ensure)
------------------------- */
/* The exact classes are already defined above with specified properties: */
/* .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; } */

/* -------------------------
   Spacing for lists in sections for readability
------------------------- */
section .text-section ul, section .text-section ol { margin-top: 4px; }

/* -------------------------
   End of stylesheet
------------------------- */
