/* ═══════════════════════════════════════════════════════════════════════
   BRFspara.se — egen CSS, oberoende av Förhandlarna/BRF.
   Designspråk: vit + grön (besparing). Accessible, klarna-clean.
   Mjuka 12px hörn. Praktisk, kalkylator-fokuserad. Light mode default.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #ffffff;
  --bg-soft: #f9fafb;
  --bg-card: #ffffff;
  --bg-elevated: #f3f4f6;
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  --text: #111827;
  --text-strong: #030712;
  --text-muted: #4b5563;
  --text-dim: #6b7280;

  --accent: #16a34a;
  --accent-hover: #15803d;
  --accent-soft: rgba(22, 163, 74, 0.08);
  --accent-strong: #14532d;

  --warning: #d97706;
  --error: #dc2626;
  --info: #2563eb;

  --radius: 12px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px -8px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Text', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 760px; }
.wrap.center { text-align: center; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: white; padding: 10px 18px;
  z-index: 100; font-weight: 600;
}
.skip-link:focus { left: 0; }

.noscript-banner {
  background: var(--warning); color: white; padding: 10px 16px;
  text-align: center; font-size: 14px; font-weight: 600;
}

/* ── Typografi ───────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
  color: var(--text-strong);
}
h1 { font-size: clamp(36px, 5vw, 56px); margin-bottom: 20px; letter-spacing: -0.03em; }
h2 { font-size: clamp(26px, 3.5vw, 36px); margin-bottom: 16px; }
h3 { font-size: 20px; margin-bottom: 10px; }
h4 { font-size: 16px; margin-bottom: 6px; }
p { margin-bottom: 14px; color: var(--text); }
strong { color: var(--text-strong); font-weight: 700; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 24px; border-radius: var(--radius);
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: all 0.15s; cursor: pointer; border: none;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent); color: white;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: white;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.btn-ghost {
  background: white;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-lg { padding: 16px 32px; font-size: 16px; }

/* ── Topbar ──────────────────────────────────────────────────────── */
.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
}
.topbar .wrap {
  display: flex; align-items: center; gap: 24px;
  padding-top: 16px; padding-bottom: 16px;
}
.topbar .brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text);
}
.topbar .brand .logo {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 16px;
}
.topbar .brand .name {
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
}
.topbar nav {
  margin-left: auto;
  display: flex; gap: 24px; align-items: center;
  font-size: 14px;
}
.topbar nav a:not(.btn) { color: var(--text-muted); font-weight: 500; }
.topbar nav a:not(.btn):hover { color: var(--text); text-decoration: none; }

/* ── Hero ────────────────────────────────────────────────────────── */
.hero {
  padding: 70px 0 50px;
  background: linear-gradient(180deg, var(--accent-soft) 0%, transparent 100%);
}
.hero .wrap.narrow { text-align: center; }
.hero .eyebrow {
  display: inline-block;
  font-size: 13px; font-weight: 600;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
}
.hero h1 { max-width: 760px; margin-left: auto; margin-right: auto; }
.hero h1 .accent { color: var(--accent); }
.hero .lead {
  font-size: 19px; color: var(--text-muted); max-width: 600px;
  margin: 0 auto 32px;
}

/* ── Calculator ──────────────────────────────────────────────────── */
.calculator {
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  margin: 32px auto 0;
  max-width: 720px;
  box-shadow: var(--shadow-lg);
  text-align: left;
}
.calculator-header {
  text-align: center;
  margin-bottom: 24px;
}
.calculator-header h3 {
  font-size: 22px;
  margin-bottom: 6px;
  color: var(--text-strong);
}
.calculator-header p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

.calc-input-row {
  margin-bottom: 16px;
}
.calc-input-row label {
  display: block;
  font-size: 14px; font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.calc-input-row .input-wrap {
  position: relative;
}
.calc-input-row input[type="number"],
.calc-input-row select {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-soft);
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.calc-input-row input[type="number"]:focus,
.calc-input-row select:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.calc-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.calc-checkbox-grid label {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}
.calc-checkbox-grid label:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.calc-checkbox-grid input:checked + span {
  font-weight: 600;
}
.calc-checkbox-grid label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.calc-checkbox-grid input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.calc-result {
  margin-top: 24px;
  padding: 24px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, rgba(22, 163, 74, 0.04) 100%);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  text-align: center;
}
.calc-result .label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.calc-result .amount {
  font-size: 44px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin: 8px 0;
}
.calc-result .amount-range {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}
.calc-result .description {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-muted);
  max-width: 480px;
  margin-left: auto; margin-right: auto;
  line-height: 1.5;
}
.calc-cta {
  margin-top: 20px;
  display: flex; gap: 12px; justify-content: center;
  flex-wrap: wrap;
}

/* ── Section ─────────────────────────────────────────────────────── */
.section { padding: 70px 0; }
.section.tight { padding: 50px 0; }
.section.alt { background: var(--bg-soft); }

.section-eyebrow {
  display: inline-block;
  font-size: 13px; font-weight: 700;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 14px;
}

/* ── Steps ───────────────────────────────────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.step {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.step .num {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 50%;
  font-weight: 800; font-size: 18px;
  margin-bottom: 14px;
}
.step h3 { font-size: 17px; margin-bottom: 8px; }
.step p { color: var(--text-muted); font-size: 14px; margin: 0; }

/* ── Examples ────────────────────────────────────────────────────── */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.example-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.example-card .size {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.example-card .saved {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  margin: 4px 0 8px;
  line-height: 1;
}
.example-card .saved-period {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
  margin-left: 4px;
}
.example-card .what {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* ── Trust badges ────────────────────────────────────────────────── */
.trust-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 32px;
}
.trust-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.trust-item .icon {
  font-size: 24px;
  line-height: 1;
  margin-top: 2px;
}
.trust-item h4 { font-size: 15px; margin-bottom: 4px; color: var(--text-strong); }
.trust-item p { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.5; }

/* ── Form ────────────────────────────────────────────────────────── */
.lead-form {
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.lead-form h3 { margin-bottom: 6px; font-size: 22px; }
.lead-form p.subtitle { color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label {
  font-size: 14px; font-weight: 600; color: var(--text);
}
.field input,
.field select,
.field textarea {
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  transition: all 0.15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 80px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.gdpr-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13px;
  cursor: pointer;
}
.gdpr-row input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px;
  accent-color: var(--accent); cursor: pointer; flex-shrink: 0;
}
.gdpr-row span { color: var(--text-muted); line-height: 1.5; }

.privacy-line {
  font-size: 12px; color: var(--text-dim);
  text-align: center; margin: 16px 0 0;
}

/* ── FAQ ─────────────────────────────────────────────────────────── */
.faq-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 600;
  color: var(--text-strong);
  font-size: 15px;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 22px; color: var(--accent); font-weight: 700;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item .answer { padding: 0 22px 20px; color: var(--text-muted); font-size: 14px; }

/* ── Privacy ─────────────────────────────────────────────────────── */
.privacy-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  font-size: 14px;
  line-height: 1.7;
}
.privacy-card p { margin-bottom: 14px; }
.privacy-card p:last-child { margin-bottom: 0; }

/* ── Footer ──────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 60px;
  background: var(--bg-soft);
}
footer .wrap {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
}
footer .left { font-size: 13px; color: var(--text-dim); }
footer .right { font-size: 13px; display: flex; gap: 18px; }
footer a { color: var(--text-muted); }
footer a:hover { color: var(--text); text-decoration: underline; }

/* ── Status ──────────────────────────────────────────────────────── */
.form-status { font-size: 13px; padding: 8px 0; min-height: 20px; }

.thank-you {
  background: linear-gradient(135deg, var(--accent-soft) 0%, rgba(22, 163, 74, 0.05) 100%);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
}
.thank-you h2 { color: var(--accent-strong); margin-bottom: 12px; }
.thank-you p { color: var(--text); font-size: 16px; margin: 0; }

/* ── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .topbar nav a:not(.btn) { display: none; }
  .hero { padding: 50px 0 40px; }
  .section { padding: 50px 0; }
  .form-grid { grid-template-columns: 1fr; }
  .lead-form, .calculator { padding: 24px 20px; }
  .calc-result .amount { font-size: 36px; }
  footer .wrap { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
