/* ===============================
   KlarRente International – style.css
   Playful Dynamic theme (bright colors, animated, fun, energetic)
   Mobile-first, Flexbox-only (no CSS Grid/Columns)
   =============================== */

/* ========== CSS Reset & Normalize ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body { line-height: 1.6; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul[role="list"], ol[role="list"] { list-style: none; }

/* ========== Design Tokens ========== */
:root {
  /* Brand */
  --brand-primary: #12355B; /* deep blue */
  --brand-secondary: #1B6B5B; /* teal */
  --brand-accent: #F3F6FA; /* light gray-blue */
  --ink: #0E2238; /* main text */
  --muted-ink: #3E556E; /* secondary text */
  --canvas: #FFFFFF; /* page background */

  /* Playful support palette */
  --pink: #FF4D6D;
  --yellow: #FFD166;
  --sky: #4CC9F0;
  --purple: #9D4EDD;
  --lime: #7AE582;
  --orange: #FF9F1C;

  /* UI */
  --shadow-sm: 0 2px 8px rgba(18, 53, 91, 0.08);
  --shadow-md: 0 10px 24px rgba(18, 53, 91, 0.12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --focus: 3px dashed var(--sky);

  /* Spacing scale */
  --s-4: 4px;  --s-8: 8px;  --s-12: 12px;  --s-16: 16px;  --s-20: 20px;  --s-24: 24px;  --s-30: 30px;  --s-32: 32px;  --s-40: 40px;  --s-48: 48px;  --s-60: 60px;  --s-72: 72px;
}

/* ========== Base Typography ========== */
body {
  font-family: Verdana, Geneva, Tahoma, sans-serif; /* brand body */
  color: var(--ink);
  background: var(--canvas);
  font-size: 16px;
}

h1, h2, h3, h4 { font-family: Georgia, 'Times New Roman', serif; /* brand display */ color: var(--brand-primary); line-height: 1.25; }

h1 { font-size: 32px; letter-spacing: 0.2px; }
h2 { font-size: 28px; margin-bottom: var(--s-16); }
h3 { font-size: 20px; }
.subheadline { color: var(--brand-secondary); font-size: 18px; margin-top: var(--s-8); }

p { color: var(--ink); }
small { font-size: 14px; color: var(--muted-ink); }

/* Fun, playful heading underline */
h1, h2 {
  position: relative;
  display: inline-flex;
  align-items: center;
}
h1:after, h2:after {
  content: "";
  display: block;
  height: 8px;
  width: 42px;
  margin-left: 10px;
  background: var(--yellow);
  border-radius: 6px;
  box-shadow: 14px 0 0 0 var(--sky), 28px 0 0 0 var(--pink);
}

/* Responsive type scale */
@media (min-width: 768px) {
  h1 { font-size: 42px; }
  h2 { font-size: 32px; }
  h3 { font-size: 22px; }
  .subheadline { font-size: 20px; }
}
@media (min-width: 1024px) {
  h1 { font-size: 48px; }
  h2 { font-size: 36px; }
}

/* ========== Layout Helpers (Flexbox-only) ========== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--s-16);
  display: flex;
  flex-direction: column;
}

/* Global sections spacing */
section { margin-bottom: var(--s-60); padding: var(--s-40) 0; }
/* Mandatory pattern: .section */
.section { margin-bottom: 60px; padding: 40px 20px; }

/* Mandatory patterns */
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: var(--s-20); transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.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; }

/* Content wrapper defaults */
.content-wrapper { display: flex; flex-direction: column; gap: var(--s-20); }

/* ========== Header & Navigation ========== */
header {
  position: sticky; top: 0; z-index: 1000;
  background: #fff;
  box-shadow: 0 1px 0 rgba(18,53,91,0.08);
}
header .container { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--s-16); padding: var(--s-12) var(--s-16); }
.logo img { height: 40px; }

.main-nav { display: none; align-items: center; gap: var(--s-12); }
.main-nav a { padding: 10px 12px; border-radius: 999px; color: var(--brand-primary); transition: background-color .2s ease, color .2s ease; }
.main-nav a:hover { background: var(--brand-accent); color: var(--brand-secondary); }
.main-nav a[aria-current="page"] { background: var(--yellow); color: #222; }

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: none; background: var(--pink); color: #fff;
  border-radius: 12px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, background-color .2s ease;
}
.mobile-menu-toggle:hover { transform: translateY(-2px); background: #ff3b5e; }
.mobile-menu-toggle:focus { outline: var(--focus); outline-offset: 3px; }

/* Mobile menu panel */
.mobile-menu {
  position: fixed; right: 0; top: 0; bottom: 0; width: 85%; max-width: 360px;
  background: #fff; box-shadow: -8px 0 24px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform .35s ease;
  display: flex; flex-direction: column; gap: var(--s-16);
  padding: var(--s-20);
  z-index: 1001;
}
/* Allow multiple activation strategies */
.mobile-menu.open, .mobile-menu.active, body.menu-open .mobile-menu { transform: translateX(0); }

.mobile-menu-close {
  align-self: flex-end;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: none; background: var(--brand-accent); color: var(--brand-primary);
  border-radius: 10px; cursor: pointer; transition: background-color .2s ease, transform .2s ease;
}
.mobile-menu-close:hover { background: #E6EEF7; transform: rotate(-8deg); }

.mobile-nav { display: flex; flex-direction: column; gap: var(--s-8); }
.mobile-nav a {
  padding: 14px 16px; border-radius: 12px; background: #fff; color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.mobile-nav a:hover { background: var(--brand-accent); }
.mobile-nav a[aria-current="page"] { background: var(--yellow); }

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

/* ========== Hero ========== */
.hero {
  background: var(--brand-accent);
  position: relative;
  overflow: hidden;
}
.hero .container { position: relative; }
.hero .content-wrapper { padding: var(--s-20) 0; gap: var(--s-16); }
.hero p { max-width: 780px; }

/* Decorative playful shapes */
.hero:before, .hero:after {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  width: 180px; height: 180px; border-radius: 50%; opacity: 0.15;
  animation: floaty 8s ease-in-out infinite;
}
.hero:before { background: var(--pink); left: -40px; top: -40px; animation-delay: .2s; }
.hero:after  { background: var(--sky); right: -50px; bottom: -60px; animation-delay: .6s; }
@keyframes floaty { 0%,100%{ transform: translateY(0) } 50%{ transform: translateY(10px) } }

/* Ensure content above shapes */
.hero .container, .hero .content-wrapper { position: relative; z-index: 1; }

/* ========== Buttons ========== */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 18px; border-radius: 999px; border: 2px solid transparent;
  font-weight: bold; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
  box-shadow: var(--shadow-sm);
}
.button.primary { background: var(--pink); color: #fff; }
.button.primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); background: #ff3b5e; }

.button.secondary { background: #fff; color: var(--brand-primary); border-color: var(--brand-primary); }
.button.secondary:hover { transform: translateY(-2px); background: var(--brand-accent); }

.button:focus { outline: var(--focus); outline-offset: 3px; }

/* CTA group */
.cta-group { display: flex; flex-wrap: wrap; gap: var(--s-12); }

/* ========== Lists, Badges, Features, Cards ========== */
.trust-badges { display: flex; flex-wrap: wrap; gap: var(--s-8); list-style: none; margin-top: var(--s-12); }
.trust-badges li { background: #fff; border: 2px solid var(--sky); color: var(--brand-primary); padding: 8px 12px; border-radius: 999px; box-shadow: var(--shadow-sm); }

.features-grid { display: flex; flex-wrap: wrap; gap: 20px; }
.feature {
  flex: 1 1 100%;
  background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  padding: var(--s-20);
  border-top: 6px solid var(--pink);
  transition: transform .2s ease, box-shadow .2s ease;
}
/* playful alternating borders */
.feature:nth-child(2) { border-top-color: var(--sky); }
.feature:nth-child(3) { border-top-color: var(--yellow); }
.feature:nth-child(4) { border-top-color: var(--purple); }
.feature:nth-child(5) { border-top-color: var(--lime); }
.feature:nth-child(6) { border-top-color: var(--orange); }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

/* Generic features-list/values/issues */
.features-list, .values, .issues, .service-list, .checklist { display: flex; flex-direction: column; gap: var(--s-8); padding-left: 0; list-style: none; }
.features-list li, .values li, .issues li, .service-list li, .checklist li {
  display: flex; align-items: center; gap: var(--s-12);
  background: #fff; border: 1px solid #E5ECF4; border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow-sm);
}

/* service-cards as colorful cards */
.service-cards { display: flex; flex-wrap: wrap; gap: 20px; list-style: none; padding-left: 0; }
.service-cards li { flex: 1 1 100%; background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: var(--s-20); border-left: 6px solid var(--brand-secondary); }
.service-cards li:nth-child(odd) { border-left-color: var(--sky); }
.service-cards li:nth-child(even) { border-left-color: var(--pink); }
.service-cards h3 { margin-bottom: var(--s-8); }

/* Steps with playful counters */
.steps { counter-reset: step; display: flex; flex-direction: column; gap: var(--s-12); padding-left: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: var(--s-12); background: #fff; border: 1px solid #E5ECF4; padding: 12px; border-radius: 14px; box-shadow: var(--shadow-sm); min-height: 48px; }
.steps li:before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--yellow); color: #222; font-weight: bold;
  box-shadow: 0 2px 0 rgba(0,0,0,0.08);
}

/* Testimonial cards - high contrast, light background */
.testimonial-card {
  background: #fff; color: var(--ink);
  border: 2px solid var(--brand-accent); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.testimonial-card p { margin: 0; }
.testimonial-card p + p { color: var(--brand-primary); }

/* Values row or column */
.values { flex-wrap: wrap; }
.values li { border-left: 5px solid var(--sky); }
.values li:nth-child(2) { border-left-color: var(--lime); }
.values li:nth-child(3) { border-left-color: var(--yellow); }
.values li:nth-child(4) { border-left-color: var(--pink); }

/* Text-image layout */
.text-image-section { align-items: center; }
.text-image-section .text { flex: 1 1 320px; display: flex; flex-direction: column; gap: var(--s-12); }

/* Contact list */
.contact-list { display: flex; flex-direction: column; gap: var(--s-8); list-style: none; padding-left: 0; }
.contact-list a { color: var(--brand-secondary); text-decoration: underline; }
.contact-list a:hover { color: var(--pink); }

/* ========== Footer ========== */
footer { background: #0F2A46; color: #E8F1FA; }
footer .container { padding: var(--s-24) var(--s-16); }
footer .content-wrapper { display: flex; flex-direction: column; gap: var(--s-16); }
.footer-nav, .legal-nav { display: flex; flex-wrap: wrap; gap: var(--s-12); }
.footer-nav a, .legal-nav a { color: #E8F1FA; background: rgba(255,255,255,0.06); padding: 8px 12px; border-radius: 10px; }
.footer-nav a:hover, .legal-nav a:hover { background: rgba(255,255,255,0.12); }

/* ========== Responsive columns with Flexbox ========== */
@media (min-width: 600px) {
  .feature { flex: 1 1 calc(50% - 10px); }
  .service-cards li { flex: 1 1 calc(50% - 10px); }
}
@media (min-width: 992px) {
  .feature { flex: 1 1 calc(33.333% - 14px); }
  .service-cards li { flex: 1 1 calc(33.333% - 14px); }
  .text-image-section { flex-direction: row; }
}

/* ========== Accessibility & Focus ========== */
a:focus, button:focus, [tabindex="0"]:focus { outline: var(--focus); outline-offset: 3px; }

/* ========== Additional Utility Classes ========== */
.hidden { display: none !important; }
.muted { color: var(--muted-ink); }

/* ========== Page-specific small tweaks ========== */
.hero .subheadline { background: #fff; display: inline-flex; padding: 6px 10px; border-radius: 10px; box-shadow: var(--shadow-sm); }

/* ========== Mobile-first Navigation visibility ========== */
/* Hide desktop nav on small screens (set above already) */

/* ========== Cookie Consent Banner & Modal ========== */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
  background: #ffffff; color: var(--ink);
  border-top: 4px solid var(--sky);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.12);
  transform: translateY(100%);
  transition: transform .35s ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .inner {
  display: flex; flex-direction: column; gap: var(--s-12);
  padding: var(--s-16); max-width: 1200px; margin: 0 auto;
}
.cookie-buttons { display: flex; flex-wrap: wrap; gap: var(--s-12); }
.cookie-buttons .button { min-width: 160px; }
.cookie-buttons .accept { background: var(--lime); color: #083A1C; border-color: transparent; }
.cookie-buttons .reject { background: #fff; color: var(--pink); border-color: var(--pink); }
.cookie-buttons .settings { background: #fff; color: var(--brand-primary); border-color: var(--brand-primary); }
.cookie-buttons .accept:hover { background: #63d96f; }

/* Cookie Preferences Modal */
.cookie-modal {
  position: fixed; inset: 0; z-index: 1200; background: rgba(14,34,56,0.6);
  display: none; align-items: center; justify-content: center; padding: var(--s-16);
}
.cookie-modal.open { display: flex; }
.cookie-modal .panel {
  background: #fff; color: var(--ink);
  width: 100%; max-width: 680px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: var(--s-16);
  padding: var(--s-20);
}
.cookie-modal h3 { margin-bottom: var(--s-8); }
.cookie-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-12); padding: 10px 12px; border: 1px solid #E5ECF4; border-radius: 12px; }
.cookie-row .always { color: var(--muted-ink); font-size: 14px; }
.cookie-modal .actions { display: flex; flex-wrap: wrap; gap: var(--s-12); justify-content: flex-end; }

/* Toggle switch */
.toggle { position: relative; width: 48px; height: 28px; background: #E5ECF4; border-radius: 999px; transition: background .2s ease; }
.toggle:after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm); transition: transform .2s ease; }
input[type="checkbox"].toggle-input { display: none; }
input[type="checkbox"].toggle-input:checked + .toggle { background: var(--sky); }
input[type="checkbox"].toggle-input:checked + .toggle:after { transform: translateX(20px); }

/* ========== Forms (if any appear later) ========== */
input[type="text"], input[type="email"], textarea { width: 100%; padding: 12px 14px; border: 1px solid #D9E3EE; border-radius: 12px; background: #fff; }
input:focus, textarea:focus { outline: var(--focus); }

/* ========== Micro-interactions & Animations ========== */
@keyframes wiggle { 0%,100%{ transform: rotate(0) } 25%{ transform: rotate(2deg) } 75%{ transform: rotate(-2deg) } }
.button.primary:active { transform: translateY(0); animation: wiggle .25s linear; }

/* ========== Ensure gaps and spacing across components ========== */
section .content-wrapper > * + * { margin-top: 0; }
section .content-wrapper { gap: var(--s-20); }

/* ========== Desktop refinements ========== */
@media (min-width: 992px) {
  header .container { padding: var(--s-16) var(--s-16); }
  .hero .content-wrapper { padding: var(--s-24) 0; }
}

/* ========== Legal pages content readability ========== */
main h2 + p { max-width: 80ch; }
main p { max-width: 80ch; }

/* ========== Strict Flexbox-only verification helpers ========== */
/* No grid or multi-column properties used. All layout via flexbox. */

/* ========== Additional selectors for classes present in HTML ========== */
.faq { display: flex; flex-direction: column; gap: var(--s-12); }
.faq h3 { color: var(--brand-secondary); }

/* Ensure minimum spacing between content cards */
.feature, .testimonial-card, .card, .service-cards li { margin-bottom: 20px; }

/* Prevent overlapping by generous padding in sections */
section > .container { padding-left: var(--s-16); padding-right: var(--s-16); }

/* Credits and footer text */
.credits { color: #CFE3F7; font-size: 14px; }

/* ========== Alignment rules per requirements ========== */
/* Already applied: align-items center on .text-image-section, testimonial-card */
/* For top-aligned stacks when needed */
.align-start { align-items: flex-start !important; }

/* ========== Accessibility contrast for testimonials ==========
   Ensured dark text on white/light background */
.testimonial-card strong { color: var(--brand-primary); }

/* ========== Edge cases & misc. ========== */
/* Make sure anchors in nav remain clear on dark footer */
footer a:focus { outline: 2px dashed #fff; outline-offset: 3px; }

/* ========== END ========== */
