/* ==========================================================
   KlarRente International – style.css
   Design: modern_bold (bold fonts, bright colors, geometric, high contrast)
   Mobile-first, Flexbox-only layouts, no CSS Grid/Columns
   ========================================================== */

/* 1) CSS Reset & Base Normalize */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 1.6; color: #102A43; background: #F5F7FA; }
img { max-width: 100%; height: auto; display: block; }
a { color: #0F3D5E; text-decoration: none; }
ul, ol { padding-left: 20px; }
button { font: inherit; background: none; border: none; cursor: pointer; }
:focus-visible { outline: 3px solid #FF6B00; outline-offset: 2px; }

/* 2) Design Tokens */
:root {
  --clr-primary: #0F3D5E;   /* Deep modern blue */
  --clr-secondary: #2E7D6A; /* Teal */
  --clr-accent: #F5F7FA;    /* Light background */
  --clr-text: #102A43;      /* Body text */
  --clr-dark: #0B2234;      /* Darker blue for headings */
  --clr-white: #FFFFFF;
  --clr-highlight: #FF6B00; /* Bold, bright accent for modern_bold CTA */
  --shadow-1: 0 6px 16px rgba(15, 61, 94, 0.12);
  --shadow-2: 0 8px 24px rgba(15, 61, 94, 0.18);
  --radius-s: 8px; --radius-m: 12px; --radius-l: 18px; --radius-xl: 26px;
  --font-display: Georgia, 'Times New Roman', Times, serif;
  --font-body: Arial, Helvetica, sans-serif;
}

/* 3) Typography (modern_bold: strong type, clear hierarchy) */
h1, h2, h3 { font-family: var(--font-display); color: var(--clr-dark); font-weight: 700; line-height: 1.2; }
h1 { font-size: 32px; letter-spacing: -0.4px; }
h2 { font-size: 26px; letter-spacing: -0.2px; margin-top: 10px; }
h3 { font-size: 20px; }
p { margin: 0 0 12px 0; }
strong { font-weight: 800; }

/* Lists with bold, geometric markers */
ul li, ol li { margin-bottom: 8px; }
ul { list-style: none; }
ul li { position: relative; padding-left: 24px; }
ul li::before { content: ''; width: 10px; height: 10px; background: var(--clr-secondary); border-radius: 2px; position: absolute; left: 0; top: 8px; }
ol { list-style: decimal-leading-zero; }

/* 4) Layout Primitives (Flexbox-only) */
.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: 16px; align-items: flex-start; }
section { margin-bottom: 48px; }

/* MANDATORY SPACING AND ALIGNMENT PATTERNS */
.section { margin-bottom: 60px; padding: 40px 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--clr-white); border-radius: var(--radius-m); box-shadow: var(--shadow-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; padding: 16px 20px; background: var(--clr-white); border: 2px solid #E6EEF5; border-radius: var(--radius-m); box-shadow: var(--shadow-1); }
.testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; background: #FFFFFF; color: #102A43; border: 2px solid #E6EEF5; border-radius: var(--radius-l); box-shadow: var(--shadow-1); }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* 5) Header & Navigation */
header { background: var(--clr-white); border-bottom: 4px solid #E6EEF5; position: relative; z-index: 10; }
header > .container { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.logo img { height: 44px; width: auto; }

.main-nav { display: none; align-items: center; gap: 18px; }
.main-nav a { color: var(--clr-primary); font-weight: 700; padding: 8px 10px; border-radius: 8px; transition: color .2s ease, background-color .2s ease, transform .15s ease; }
.main-nav a:hover { color: var(--clr-white); background: var(--clr-primary); transform: translateY(-1px); }
/* Emphasize key CTAs in nav via attribute selector */
.main-nav a[href*="termin"], .main-nav a[href*="rentencheck"] { background: var(--clr-highlight); color: #0B2234; padding: 8px 14px; border-radius: 999px; }
.main-nav a[href*="termin"]:hover, .main-nav a[href*="rentencheck"]:hover { background: #ff7f2a; color: #0B2234; }

/* Mobile menu toggle */
.mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; background: var(--clr-primary); color: var(--clr-white); font-size: 22px; transition: transform .15s ease, background-color .2s ease; }
.mobile-menu-toggle:hover { transform: scale(1.04); background: #124a73; }

/* Mobile menu overlay */
.mobile-menu { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; background: var(--clr-white); transform: translateX(100%); transition: transform .35s ease; display: flex; flex-direction: column; gap: 10px; padding: 18px; z-index: 1000; box-shadow: var(--shadow-2); }
.mobile-menu.open, .mobile-menu.active, .mobile-menu[aria-expanded="true"] { transform: translateX(0%); }
.mobile-menu-close { align-self: flex-end; width: 44px; height: 44px; border-radius: 10px; background: #E6EEF5; color: var(--clr-dark); font-size: 20px; }
.mobile-nav { display: flex; flex-direction: column; gap: 6px; }
.mobile-nav a { display: block; padding: 14px 12px; border-radius: 12px; font-weight: 700; color: var(--clr-primary); background: #F9FBFD; border: 2px solid #E6EEF5; transition: background-color .2s ease, transform .15s ease; }
.mobile-nav a:hover { background: var(--clr-accent); transform: translateX(2px); }
.mobile-nav a[href*="termin"], .mobile-nav a[href*="rentencheck"] { background: var(--clr-highlight); color: #0B2234; border-color: transparent; }

/* 6) Hero (bold, geometric, high contrast) */
.hero { position: relative; background: var(--clr-primary); color: var(--clr-white); padding: 48px 0; overflow: hidden; }
.hero .content-wrapper h1, .hero .content-wrapper p { color: var(--clr-white); }
.hero .content-wrapper { gap: 16px; }
/* Decorative geometric block */
.hero::after { content: ""; position: absolute; right: -100px; top: -60px; width: 280px; height: 280px; background: var(--clr-secondary); opacity: .18; transform: rotate(25deg); border-radius: 24px; pointer-events: none; }
.hero::before { content: ""; position: absolute; left: -80px; bottom: -60px; width: 220px; height: 220px; background: var(--clr-highlight); opacity: .15; transform: rotate(-18deg); border-radius: 32px; pointer-events: none; }

/* CTA Buttons (links inside .cta-group) */
.cta-group { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-group a { display: inline-flex; align-items: center; justify-content: center; padding: 12px 18px; border-radius: 14px; font-weight: 800; letter-spacing: 0.2px; transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease; box-shadow: var(--shadow-1); }
.cta-group a:first-child { background: var(--clr-highlight); color: #0B2234; }
.cta-group a:first-child:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); background: #ff7f2a; }
.cta-group a:last-child { background: var(--clr-white); color: var(--clr-primary); border: 2px solid #E6EEF5; }
.cta-group a:last-child:hover { background: #F9FBFD; transform: translateY(-2px); }

/* 7) Content Blocks */
.text-image-section h3 { margin-bottom: 2px; color: var(--clr-primary); }
.text-image-section a { font-weight: 800; color: var(--clr-secondary); padding: 8px 12px; border-radius: 10px; border: 2px solid #D9ECE6; transition: background-color .2s ease, transform .15s ease; }
.text-image-section a:hover { background: #ECF7F4; transform: translateY(-1px); }

.testimonial-card p { margin: 0; }
.testimonial-card p + p { opacity: 0.9; }

/* Links in body copy */
main a:not(.mobile-nav a):not(.main-nav a):not(.cta-group a) {
  color: var(--clr-secondary); font-weight: 700; border-bottom: 2px solid rgba(46, 125, 106, 0.25); padding-bottom: 1px; transition: color .2s ease, border-color .2s ease;
}
main a:not(.mobile-nav a):not(.main-nav a):not(.cta-group a):hover { color: #1f5f51; border-color: rgba(31, 95, 81, 0.5); }

/* 8) Footer */
footer { background: #0E1F2E; color: #DCE7F2; padding-top: 28px; padding-bottom: 28px; margin-top: 40px; }
footer .logo img { height: 36px; }
footer a { color: #DCE7F2; opacity: 0.95; transition: opacity .2s ease, transform .15s ease; }
footer a:hover { opacity: 1; transform: translateY(-1px); }
footer .content-wrapper { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
footer .content-wrapper > * { flex: 1 1 240px; }
footer .container:last-child { padding-top: 10px; border-top: 2px solid #20374b; }

/* 9) Cards (generic) */
.card .title { font-family: var(--font-display); font-weight: 800; color: var(--clr-primary); }
.card .btn, .btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; background: var(--clr-primary); color: var(--clr-white); font-weight: 800; box-shadow: var(--shadow-1); transition: transform .15s ease, box-shadow .2s ease; }
.card .btn:hover, .btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }

/* 10) Global spacing utilities (8/16/24/32 rhythm) */
.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; }
.gap-16 { gap: 16px; } .gap-24 { gap: 24px; } .gap-32 { gap: 32px; }

/* 11) Responsive Rules (mobile-first) */
@media (min-width: 680px) {
  h1 { font-size: 38px; }
  h2 { font-size: 28px; }
  section { margin-bottom: 56px; }
}
@media (min-width: 992px) {
  .main-nav { display: flex; }
  .mobile-menu-toggle { display: none; }
  .text-image-section { flex-wrap: nowrap; justify-content: space-between; }
  .text-image-section > * { flex: 1 1 45%; }
  .hero { padding: 68px 0; }
  h1 { font-size: 48px; }
  h2 { font-size: 32px; }
}

/* 12) Tables (if any appear in legal pages) */
table { width: 100%; border-collapse: collapse; border: 2px solid #E6EEF5; border-radius: 10px; overflow: hidden; display: block; }
tr { display: flex; width: 100%; }
th, td { flex: 1 1 0; padding: 10px; border-bottom: 1px solid #E6EEF5; }
th { background: #ECF2F8; text-align: left; font-weight: 800; color: var(--clr-primary); }

/* 13) Mobile Navigation Animations (smooth slide) */
@keyframes slideInMenu { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideOutMenu { from { transform: translateX(0); } to { transform: translateX(100%); } }
.mobile-menu.open, .mobile-menu.active, .mobile-menu[aria-expanded="true"] { animation: slideInMenu .35s ease both; }

/* 14) Cookie Consent Banner & Modal (flex-only) */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; background: var(--clr-dark); color: var(--clr-white); display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; z-index: 999; box-shadow: 0 -6px 18px rgba(0,0,0,.18); transform: translateY(100%); transition: transform .35s ease; }
.cookie-banner.show { transform: translateY(0%); }
.cookie-banner .cookie-content { display: flex; flex-direction: column; gap: 10px; }
.cookie-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-buttons .btn { border-radius: 12px; font-weight: 800; padding: 10px 14px; }
.cookie-accept { background: var(--clr-highlight); color: #0B2234; }
.cookie-reject { background: #20374B; color: var(--clr-white); }
.cookie-settings { background: var(--clr-white); color: var(--clr-primary); }
.cookie-accept:hover { background: #ff7f2a; }
.cookie-reject:hover { background: #2a4a62; }
.cookie-settings:hover { background: #F0F6FC; }

/* Cookie modal overlay */
.cookie-overlay { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; background: rgba(11, 34, 52, 0.6); display: none; align-items: center; justify-content: center; z-index: 1001; }
.cookie-overlay.show { display: flex; }
.cookie-modal { width: 94vw; max-width: 680px; background: var(--clr-white); color: var(--clr-text); border-radius: 18px; box-shadow: var(--shadow-2); display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.cookie-modal .modal-header { display: flex; align-items: center; justify-content: space-between; }
.cookie-modal .modal-body { display: flex; flex-direction: column; gap: 14px; }
.cookie-modal .modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* Cookie toggles */
.cookie-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 2px solid #E6EEF5; border-radius: 12px; }
.cookie-toggle .label { font-weight: 700; color: var(--clr-primary); }
.switch { width: 46px; height: 26px; background: #CBD6E2; border-radius: 999px; position: relative; transition: background-color .2s ease; }
.switch::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; background: var(--clr-white); left: 3px; top: 3px; transition: transform .2s ease; }
.switch.on { background: var(--clr-secondary); }
.switch.on::after { transform: translateX(20px); }

/* 15) Forms (generic, if added later) */
input, textarea, select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 2px solid #E6EEF5; background: #FFFFFF; color: var(--clr-text); }
label { font-weight: 700; color: var(--clr-primary); margin-bottom: 6px; display: inline-block; }

/* 16) Ensuring readable testimonials (dark text on light bg) */
.testimonial-card { background: #FFFFFF; color: #0B2234; }
.testimonial-card strong { color: var(--clr-primary); }

/* 17) Legal pages improvements */
.hero + section .content-wrapper { background: transparent; box-shadow: none; border: none; padding: 0; }

/* 18) Prevent overlapping & maintain breathing room */
section .container { gap: 20px; }
.content-wrapper > * + * { margin-top: 4px; }

/* 19) Micro-interactions */
@keyframes softPop { 0% { transform: scale(1); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
.cta-group a:active { animation: softPop .2s ease; }

/* 20) Accessibility helpers */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* 21) Additional layout helpers (flex-only) */
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.col { flex: 1 1 280px; }
.center { display: flex; align-items: center; justify-content: center; }

/* 22) Make sure all common blocks have minimum spacing */
main > section .testimonial-card, main > section .text-image-section, main > section .card { margin-top: 8px; }

/* 23) High-contrast badges (if needed) */
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-weight: 800; background: #0F3D5E; color: #FFFFFF; }

/* 24) Print tweaks */
@media print { .mobile-menu, .mobile-menu-toggle, .cookie-banner, .cookie-overlay { display: none !important; } a { text-decoration: underline; } }
