/* =========================================
   Soft Haze Finansskydd — style.css
   Aesthetic: soft_pastel (pastel colors, gentle, dreamy)
   Layout: Mobile-first, ONLY Flexbox (no grid/columns)
   ========================================= */

/* ------------ CSS Reset & Base Normalize ------------ */
*, *::before, *::after { box-sizing: border-box; }
html { line-height: 1.15; -webkit-text-size-adjust: 100%; }
body { margin: 0; }
h1, h2, h3, h4, h5, h6, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { padding-left: 1.1rem; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus { outline: none; }
:focus-visible { outline: 2px solid #8BC8FF; outline-offset: 2px; }

/* ------------ Theme Tokens ------------ */
:root {
  /* Brand */
  --brand-primary: #163A5F; /* deep calm blue */
  --brand-secondary: #2E7D6C; /* soft teal */
  --brand-accent: #F3F7FB; /* light sky */
  /* Soft pastel palette */
  --pastel-sky: #EAF4FF;
  --pastel-mint: #E6F5F1;
  --pastel-lilac: #F3EAFE;
  --pastel-peach: #FFEFE6;
  --pastel-sand: #F8F5F2;
  /* Surfaces & text */
  --surface: #FFFFFF;
  --surface-2: #F9FBFD;
  --surface-3: #EEF4F8;
  --text-strong: #1D3348;
  --text: #2A3B4A;
  --text-muted: #5B6B7A;
  /* Effects */
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 4px 12px rgba(22, 58, 95, 0.10);
  --shadow-md: 0 8px 24px rgba(22, 58, 95, 0.12);
  --ring: 0 0 0 3px rgba(139,200,255,0.35);
  /* Spacing scale */
  --sp-4: 4px; --sp-8: 8px; --sp-12: 12px; --sp-16: 16px; --sp-20: 20px; --sp-24: 24px; --sp-30: 30px; --sp-32: 32px; --sp-40: 40px; --sp-60: 60px;
}

/* ------------ Base Typography ------------ */
html { font-size: 16px; }
body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; color: var(--text-strong); }

h1 { font-size: 32px; line-height: 1.2; letter-spacing: 0.2px; }
h2 { font-size: 24px; line-height: 1.25; margin-bottom: var(--sp-16); }
h3 { font-size: 18px; line-height: 1.3; margin-top: var(--sp-16); margin-bottom: var(--sp-8); }
p { font-size: 16px; line-height: 1.65; color: var(--text); }
.small, .kpi, .hero nav[aria-label], .subheadline { font-size: 15px; color: var(--text-muted); }
.subheadline { line-height: 1.6; }
.tagline { font-size: 14px; color: var(--brand-secondary); opacity: 0.9; }

/* Links */
a { color: var(--brand-secondary); text-decoration-color: rgba(46,125,108,0.35); text-underline-offset: 3px; }
a:hover { text-decoration: underline; }

/* Lists */
ul { display: block; }
li { margin-bottom: var(--sp-8); }

/* ------------ Layout Utilities (Flex Only) ------------ */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--sp-20);
  display: flex;
  flex-direction: column;
  gap: var(--sp-20);
}
.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
}
.content-grid { /* mandatory flex pattern */
  display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between;
}
.text-image-section { /* mandatory flex pattern */
  display: flex; align-items: center; gap: 30px; flex-wrap: wrap;
}
.feature-item { /* mandatory flex pattern */
  display: flex; flex-direction: column; align-items: flex-start; gap: 15px;
}
.card-container { /* mandatory flex pattern */
  display: flex; flex-wrap: wrap; gap: 24px;
}
.card { margin-bottom: 20px; position: relative; }
.testimonial-card { /* mandatory flex pattern */
  display: flex; align-items: center; gap: 20px; padding: 20px;
}
.section { /* mandatory spacing pattern */
  margin-bottom: 60px; padding: 40px 20px;
}
section { margin-bottom: var(--sp-60); }

/* ------------ Header & Navigation ------------ */
header { position: relative; background: var(--surface); box-shadow: var(--shadow-sm); }
header .container { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--sp-16); padding-top: var(--sp-12); padding-bottom: var(--sp-12); }
.logo { display: inline-flex; align-items: center; }
.logo img { height: 36px; width: auto; }

.main-nav { display: none; align-items: center; gap: var(--sp-16); }
.main-nav a { color: var(--text); font-size: 15px; padding: 8px 10px; border-radius: 8px; transition: background 0.2s ease, color 0.2s ease; }
.main-nav a:hover { background: var(--pastel-mint); color: var(--brand-secondary); }

.header-cta { display: none; align-items: center; gap: var(--sp-12); }

/* Mobile menu */
.mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: none; background: var(--pastel-lilac); color: var(--text-strong); cursor: pointer; box-shadow: var(--shadow-sm); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.mobile-menu-toggle:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.mobile-menu {
  position: fixed; inset: 0; background: var(--surface-2);
  display: flex; flex-direction: column; gap: var(--sp-16);
  transform: translateX(100%);
  transition: transform 0.32s ease;
  z-index: 2000; padding: var(--sp-20);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-close { align-self: flex-end; border: none; background: var(--pastel-peach); color: var(--text-strong); width: 40px; height: 40px; border-radius: 10px; cursor: pointer; box-shadow: var(--shadow-sm); }
.mobile-nav { display: flex; flex-direction: column; gap: var(--sp-12); }
.mobile-nav a { font-size: 18px; padding: 14px 12px; border-radius: 12px; background: var(--surface); color: var(--text-strong); box-shadow: var(--shadow-sm); }
.mobile-nav a:active { transform: translateY(1px); }

/* ------------ Hero ------------ */
.hero { position: relative; background: var(--pastel-sky); padding: var(--sp-40) 0; }
.hero .container { gap: 0; }
.hero .content-wrapper { gap: var(--sp-16); }
.hero h1 { font-size: 30px; }
.hero .cta-group { margin-top: var(--sp-8); }
.hero nav[aria-label] a { color: var(--text-muted); font-size: 14px; }
.hero nav[aria-label] a:hover { color: var(--brand-secondary); text-decoration: underline; }

/* Decorative pastel bubbles (decorative only) */
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; z-index: 0; }
.hero::before { width: 220px; height: 220px; background: var(--pastel-lilac); top: -60px; right: -60px; opacity: 0.4; }
.hero::after { width: 180px; height: 180px; background: var(--pastel-mint); bottom: -50px; left: -50px; opacity: 0.35; }
.hero .content-wrapper, .hero .container { position: relative; z-index: 1; }

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

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: var(--radius-lg); border: 2px solid transparent; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease; text-decoration: none; font-weight: 600; }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--brand-primary); color: #fff; box-shadow: var(--shadow-sm); }
.button.primary:hover { box-shadow: var(--shadow-md); }
.button.secondary { background: var(--pastel-mint); color: var(--brand-secondary); border-color: rgba(46,125,108,0.25); }
.button.secondary:hover { background: #D9F0EA; border-color: rgba(46,125,108,0.45); }
.button:focus-visible { box-shadow: var(--ring); }

.trust-badges ul { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-12); list-style: none; padding: 0; }
.trust-badges li { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--surface-3); padding: 10px 12px; border-radius: 999px; color: var(--text); box-shadow: var(--shadow-sm); }
.trust-badges img { height: 18px; width: 18px; }

.benefit-bullets { display: flex; flex-direction: column; gap: 8px; }
.benefit-bullets li { position: relative; padding-left: 10px; }

.kpi { background: var(--pastel-peach); color: var(--text-strong); border: 1px solid #FFD8C4; padding: 10px 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; }

.text-section { display: flex; flex-direction: column; gap: var(--sp-12); background: var(--surface); border: 1px solid var(--surface-3); padding: var(--sp-16); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.text-section details { background: var(--surface-2); border: 1px solid var(--surface-3); border-radius: var(--radius-md); padding: 10px 12px; }
.text-section summary { cursor: pointer; font-weight: 600; color: var(--text-strong); display: flex; align-items: center; justify-content: space-between; }
.text-section details[open] summary { color: var(--brand-secondary); }

/* Testimonials — high contrast on light background */
.testimonial-card { background: #FFFFFF; border: 1px solid var(--surface-3); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); color: var(--text-strong); }
.testimonial-card p { margin: 0; }

/* Footer */
footer { background: var(--pastel-sand); border-top: 1px solid var(--surface-3); }
footer section { margin-bottom: 0; padding: var(--sp-40) 0; }
footer .content-wrapper { display: flex; flex-wrap: wrap; gap: var(--sp-20); }
footer .text-section { background: transparent; border: none; box-shadow: none; padding: 0; }
footer nav a { color: var(--text); }
footer nav a:hover { color: var(--brand-secondary); text-decoration: underline; }

/* General sections */
section > .container > .content-wrapper > h2 { font-size: 22px; }

/* ------------ Cookie Consent (Banner & Modal) ------------ */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--surface-3);
  box-shadow: 0 -8px 24px rgba(22,58,95,0.08);
  display: flex; flex-direction: column; gap: var(--sp-12);
  padding: 14px var(--sp-20);
  transform: translateY(100%);
  transition: transform 0.35s ease;
  z-index: 3000;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner .row { display: flex; flex-direction: column; gap: var(--sp-12); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: var(--sp-12); }
.cookie-actions .accept { background: var(--brand-primary); color: #fff; }
.cookie-actions .reject { background: var(--pastel-lilac); color: var(--text-strong); }
.cookie-actions .settings { background: var(--pastel-mint); color: var(--brand-secondary); }
.cookie-actions .button { padding: 10px 14px; border-radius: 12px; }

.cookie-backdrop { position: fixed; inset: 0; background: rgba(17,24,39,0.35); opacity: 0; pointer-events: none; transition: opacity 0.25s ease; z-index: 4000; }
.cookie-backdrop.open { opacity: 1; pointer-events: auto; }

.cookie-modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.96);
  width: 92%; max-width: 720px; background: var(--surface);
  border: 1px solid var(--surface-3); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--sp-20);
  display: flex; flex-direction: column; gap: var(--sp-16);
  z-index: 4100; opacity: 0; pointer-events: none; transition: transform 0.25s ease, opacity 0.25s ease;
}
.cookie-modal.open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.cookie-modal .modal-header { display: flex; align-items: center; justify-content: space-between; }
.cookie-modal .modal-body { display: flex; flex-direction: column; gap: var(--sp-12); }
.cookie-modal .category { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); background: var(--surface-2); border: 1px solid var(--surface-3); padding: 12px; border-radius: var(--radius-md); }
.cookie-modal .modal-actions { display: flex; flex-wrap: wrap; gap: var(--sp-12); justify-content: flex-end; }

/* Toggle switch (for cookie categories) */
.toggle { position: relative; width: 46px; height: 26px; background: #dfe8ef; border-radius: 999px; transition: background 0.2s ease; border: 1px solid var(--surface-3); display: inline-flex; align-items: center; }
.toggle input { position: absolute; opacity: 0; }
.toggle .knob { width: 20px; height: 20px; background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm); transform: translateX(3px); transition: transform 0.2s ease; }
.toggle input:checked + .knob { transform: translateX(23px); }
.toggle input:checked ~ .track { background: var(--pastel-mint); }

/* ------------ Responsive Media Queries ------------ */
@media (min-width: 600px) {
  h1 { font-size: 34px; }
  .hero h1 { font-size: 36px; }
  .container { gap: var(--sp-24); }
}

@media (min-width: 768px) {
  .text-image-section { flex-direction: row; }
  .hero { padding: 56px 0; }
  .hero .content-wrapper { max-width: 880px; }
  h2 { font-size: 26px; }
  h3 { font-size: 20px; }
}

@media (min-width: 992px) {
  header .container { gap: var(--sp-20); }
  .main-nav { display: flex; }
  .header-cta { display: inline-flex; }
  .mobile-menu-toggle { display: none; }
  .hero h1 { font-size: 44px; }
  footer .content-wrapper { justify-content: space-between; }
  footer .text-section { flex: 1 1 260px; }
}

/* ------------ Additional Structural Styles ------------ */
/* Ensure no overlapping by generous spacing */
section .container { gap: var(--sp-20); }

/* Lists inside content blocks */
.text-section ul, .content-wrapper ul { padding-left: 1.1rem; }
.text-section ol, .content-wrapper ol { padding-left: 1.1rem; }

/* Inline icons alignment */
.text-section img, p img { display: inline-block; vertical-align: middle; margin: 0 6px 0 0; }

/* Breadcrumb spacing */
[aria-label="Brödsmulor"] { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--sp-8); color: var(--text-muted); }

/* Cards (generic) */
.card { background: var(--surface); border: 1px solid var(--surface-3); border-radius: var(--radius-lg); padding: var(--sp-16); box-shadow: var(--shadow-sm); }

/* Alignments for common wrappers */
header nav[aria-label], footer nav[aria-label] { display: flex; flex-wrap: wrap; gap: 8px; }

/* Micro interactions */
.button:hover { transform: translateY(-1px); }

/* Prevent content overlap near decorative bubbles on small screens */
@media (max-width: 420px) {
  .hero::before, .hero::after { opacity: 0.25; }
}

/* ------------ Accessibility Enhancements ------------ */
button:focus-visible, .mobile-menu-toggle:focus-visible, .mobile-menu-close:focus-visible, .button:focus-visible, a.button:focus-visible { box-shadow: var(--ring); }

/* ------------ Specific Page Touches ------------ */
/* Pricing and plan sections get a gentle backdrop */
body:has(main .hero h1:contains("Välj din plan")) main section:not(.hero) .text-section { background: var(--pastel-lilac); border-color: #E6DBFA; }
/* Note: :has() and :contains() are progressive; safe fallback is prior styles. */

/* ------------ Assured Flexbox-only Layout Helpers ------------ */
/* For any potential grids in content areas, use wrap + basis */
.flex-row { display: flex; flex-wrap: wrap; gap: var(--sp-20); }
.flex-col { display: flex; flex-direction: column; gap: var(--sp-12); }

/* ------------ Print Basics ------------ */
@media print {
  .mobile-menu, .mobile-menu-toggle, .cookie-banner, .cookie-backdrop, .cookie-modal { display: none !important; }
  a { text-decoration: underline; }
}

/* ------------ Contrast Assurance for Testimonials ------------ */
/* Dark text on light cards — enforced */
.testimonial-card, .testimonial-card * { color: var(--text-strong); }

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