/* ── DARK THEME (default) ── */
:root, [data-theme="dark"] {
  --red: #E54424;
  --red-hover: #C43B1E;
  --red-dim: rgba(229,68,36,0.10);
  --red-glow: rgba(229,68,36,0.30);
  --red-light: #F4C59D;
  --dark: #1A1A1A;
  --surface: #242424;
  --surface2: #2E2E2E;
  --surface3: #363636;
  --border: rgba(255,255,255,0.10);
  --border-active: rgba(229,68,36,0.5);
  --text: #F2F2F2;
  --text-muted: #9E9E9E;
  --text-dim: #B8B8B8;
  --green: #22C55E;
  --amber: #F59E0B;
  --white: #FFFFFF;
  --glow-r: 229; --glow-g: 68; --glow-b: 36;
  --print-bg: white; --print-text: #111; --print-muted: #666;
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --red: #C43B1E;
  --red-hover: #B52704;
  --red-dim: rgba(212,46,6,0.08);
  --red-glow: rgba(212,46,6,0.15);
  --red-light: #F4C59D;
  --dark: #F2F2F2;
  --surface: #FFFFFF;
  --surface2: #E8E8E8;
  --surface3: #DEDEDE;
  --border: rgba(0,0,0,0.08);
  --border-active: rgba(212,46,6,0.4);
  --text: #1A1A1A;
  --text-muted: #6B6B6B;
  --text-dim: #505050;
  --green: #16A34A;
  --amber: #D97706;
  --white: #FFFFFF;
  --glow-r: 212; --glow-g: 46; --glow-b: 6;
}
[data-theme="light"] .item-card.active .check { background:#E54424; border-color:#E54424; }
[data-theme="light"] .drift-badge { background:#E54424; }

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* BG texture */
body::before {
  content:'';
  position:fixed;
  inset:0;
  background:
    radial-gradient(ellipse 60% 40% at 80% 10%, rgba(var(--glow-r),var(--glow-g),var(--glow-b),0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(var(--glow-r),var(--glow-g),var(--glow-b),0.04) 0%, transparent 50%);
  pointer-events:none;
  z-index:0;
}

.wrap { position:relative; z-index:1; max-width:1080px; margin:0 auto; padding:0 24px 80px; }

/* ── TOP BAR ── */
.topbar {
  display:flex; align-items:center; justify-content:space-between;
  padding:20px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom:48px;
}
.logo {
  font-family:'Syne',sans-serif; font-weight:800; font-size:18px; letter-spacing:-0.5px;
  display:flex; align-items:center; gap:10px;
}
.logo-img { height:28px; width:auto; }
.tagline { font-family:'DM Mono',monospace; font-size:11px; color:var(--text-muted); letter-spacing:1px; }
.nav-link {
  font-family:'DM Mono',monospace; font-size:11px; color:var(--text-muted);
  text-decoration:none; letter-spacing:0.5px; transition:all 0.2s;
  border:1px solid var(--border); padding:6px 12px; border-radius:5px;
}
.nav-link:hover { color:var(--red); border-color:var(--red); }
.skip-drift-btn {
  background:none; border:none; color:var(--text-muted);
  font-family:'DM Mono',monospace; font-size:11px;
  cursor:pointer; padding:6px 12px; letter-spacing:0.5px;
  transition:all 0.2s; opacity:0.6;
}
.skip-drift-btn:hover { color:var(--red); opacity:1; }

/* ── THEME TOGGLE ── */
.theme-toggle {
  background:var(--surface); border:1px solid var(--border);
  color:var(--text-muted); font-size:16px; line-height:1;
  width:34px; height:34px; border-radius:6px;
  cursor:pointer; transition:all 0.2s;
  display:flex; align-items:center; justify-content:center;
}
.theme-toggle:hover { border-color:var(--red); color:var(--text); }

/* ── HERO ── */
.hero { margin-bottom:52px; }
.hero h1 {
  font-family:'Syne',sans-serif; font-weight:800; font-size:clamp(32px,5vw,52px);
  line-height:1.05; letter-spacing:-1.5px; margin-bottom:12px;
}
.hero h1 em { color:var(--red); font-style:normal; }
.hero p { color:var(--text-dim); font-size:15px; max-width:480px; line-height:1.6; }

/* ── CUSTOMER INPUT ── */
.customer-bar {
  display:grid; grid-template-columns:1fr 1fr auto;
  gap:12px; margin-bottom:48px;
}
.input-group { display:flex; flex-direction:column; gap:6px; }
.input-group label { font-family:'DM Mono',monospace; font-size:10px; color:var(--text-muted); letter-spacing:1px; text-transform:uppercase; }
.input-group input {
  background:var(--surface2); border:1px solid var(--border);
  color:var(--text); font-family:'DM Sans',sans-serif; font-size:14px;
  padding:10px 14px; border-radius:6px; outline:none; transition:border 0.2s;
}
.input-group input:focus { border-color:var(--border-active); }
.reset-btn {
  align-self:flex-end;
  background:transparent; border:1px solid var(--border);
  color:var(--text-muted); font-size:12px; font-family:'DM Mono',monospace;
  padding:10px 16px; border-radius:6px; cursor:pointer; transition:all 0.2s;
  letter-spacing:0.5px;
}
.reset-btn:hover { border-color:var(--red); color:var(--red); }

/* ── LAYOUT GRID ── */
.layout { display:grid; grid-template-columns:1fr 360px; gap:32px; align-items:start; }

/* ── SECTION ── */
.section { margin-bottom:32px; }
.section-label {
  font-family:'DM Mono',monospace; font-size:10px; letter-spacing:2px;
  color:var(--text-muted); text-transform:uppercase; margin-bottom:16px;
  display:flex; align-items:center; gap:10px;
}
.section-label::after { content:''; flex:1; height:1px; background:var(--border); }

/* ── ITEM CARD ── */
.item-grid { display:flex; flex-direction:column; gap:8px; }
.item-card {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  padding:14px 16px;
  display:grid;
  grid-template-columns:20px auto 1fr auto;
  align-items:center;
  gap:12px;
  cursor:pointer;
  transition:all 0.18s;
  user-select:none;
}
.item-card:hover { border-color:rgba(255,255,255,0.15); background:var(--surface2); }
.item-card.active {
  border-color:var(--border-active);
  background:rgba(229,68,36,0.06);
}
.item-card.active .check { background:var(--red); border-color:var(--red); }
.item-card.active .check::after { opacity:1; }

.check {
  width:18px; height:18px; border:1.5px solid var(--border);
  border-radius:4px; position:relative; transition:all 0.15s; flex-shrink:0;
}
.check::after {
  content:''; position:absolute; top:2px; left:5px;
  width:5px; height:9px; border:2px solid white;
  border-top:none; border-left:none;
  transform:rotate(45deg); opacity:0; transition:opacity 0.1s;
}

.item-icon { font-size:16px; }
.item-info { min-width:0; }
.item-name { font-size:13.5px; font-weight:500; color:var(--text); margin-bottom:2px; }
.item-desc { font-size:11px; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.item-price-wrap { text-align:right; }
.item-price {
  font-family:'DM Mono',monospace; font-size:13px; font-weight:500;
  color:var(--text-dim); white-space:nowrap;
}
.item-price .price-type { font-size:9px; color:var(--text-muted); display:block; margin-top:1px; }

/* Qty stepper */
.qty-wrap { display:flex; align-items:center; gap:6px; }
.qty-btn {
  width:24px; height:24px; border-radius:4px;
  background:var(--surface3); border:1px solid var(--border);
  color:var(--text); font-size:14px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:all 0.15s;
}
.qty-btn:hover { border-color:var(--red); color:var(--red); }
.qty-val { font-family:'DM Mono',monospace; font-size:13px; min-width:18px; text-align:center; }

/* ── DRIFT SELECTOR ── */
.drift-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.drift-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:10px; padding:16px; cursor:pointer; transition:all 0.18s;
  position:relative; overflow:hidden;
}
.drift-card::before {
  content:''; position:absolute; top:0; left:0; right:0; height:2px;
  background:transparent; transition:background 0.2s;
}
.drift-card:hover { border-color:rgba(255,255,255,0.15); }
.drift-card.selected { border-color:var(--border-active); background:rgba(229,68,36,0.06); }
.drift-card.selected::before { background:var(--red); }
.drift-card.recommended { order:-1; }
.drift-tier { font-family:'DM Mono',monospace; font-size:10px; letter-spacing:1px; color:var(--text-muted); margin-bottom:6px; }
.drift-name { font-family:'Syne',sans-serif; font-weight:700; font-size:16px; margin-bottom:4px; }
.drift-base { font-family:'DM Mono',monospace; font-size:18px; font-weight:500; color:var(--text); margin:8px 0 2px; }
.drift-base span { font-size:11px; color:var(--text-muted); font-weight:400; }
.drift-per { font-size:11px; color:var(--text-muted); margin-bottom:10px; }
.drift-badge {
  display:inline-block; background:var(--red); color:white;
  font-family:'DM Mono',monospace; font-size:9px; letter-spacing:1px;
  padding:2px 7px; border-radius:3px; margin-bottom:8px;
}
.drift-features { list-style:none; }
.drift-features li {
  font-size:11px; color:var(--text-muted); padding:2px 0;
  display:flex; gap:6px; align-items:baseline;
}
.drift-features li::before { content:'→'; color:var(--red); font-size:9px; flex-shrink:0; }
.drift-features li.dim::before { content:'—'; color:var(--border); }
.drift-features li.dim { opacity:0.4; }

/* ── SUMMARY PANEL ── */
.summary {
  position:sticky; top:24px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:14px; padding:24px; overflow:hidden;
}
.summary::before {
  content:''; position:absolute; top:0; left:0; right:0; height:3px;
  background:linear-gradient(90deg, var(--red), transparent);
}
.summary-title {
  font-family:'Syne',sans-serif; font-weight:700; font-size:16px;
  margin-bottom:8px;
}
.summary-customer {
  font-family:'DM Mono',monospace; font-size:11px; color:var(--red);
  margin-bottom:20px; letter-spacing:0.5px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%;
}

.summary-lines { border-top:1px solid var(--border); padding-top:16px; margin-bottom:16px; }
.summary-line {
  display:flex; justify-content:space-between; align-items:baseline;
  padding:5px 0; font-size:12.5px; color:var(--text-dim);
  border-bottom:1px solid rgba(255,255,255,0.03);
}
.summary-line .lbl { max-width:200px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.summary-line .amt { font-family:'DM Mono',monospace; font-size:12px; white-space:nowrap; margin-left:8px; }
.summary-line.drift-line { color:var(--amber); }
.summary-line.sub { color:var(--text-muted); font-size:11px; }

.summary-divider { height:1px; background:var(--border); margin:14px 0; }
.summary-line.setup-line { color:var(--green); }
.sum-breakdown { margin-bottom:8px; }
.breakdown-row {
  display:flex; justify-content:space-between; align-items:baseline;
  padding:2px 0; font-size:11px; color:var(--text-muted);
  font-family:'DM Mono',monospace;
}

.summary-total-wrap { margin-top:4px; }
.total-label { font-family:'DM Mono',monospace; font-size:10px; letter-spacing:1px; color:var(--text-muted); margin-bottom:6px; }
.total-onetime {
  display:flex; justify-content:space-between; align-items:baseline;
  margin-bottom:6px;
}
.total-onetime .tl { font-size:13px; color:var(--text-dim); }
.total-onetime .tv { font-family:'DM Mono',monospace; font-size:14px; color:var(--text); }

.total-monthly {
  display:flex; justify-content:space-between; align-items:baseline;
  background:rgba(229,68,36,0.08); border:1px solid rgba(229,68,36,0.2);
  border-radius:8px; padding:12px 14px; margin-top:10px;
}
.total-monthly .tl { font-family:'Syne',sans-serif; font-weight:700; font-size:13px; }
.total-monthly .tv { font-family:'DM Mono',monospace; font-size:22px; font-weight:500; color:var(--text); }
.total-monthly .tv span { font-size:11px; color:var(--text-muted); }

.per-day {
  text-align:right; font-family:'DM Mono',monospace; font-size:11px;
  color:var(--text-muted); margin-top:6px;
}
.per-day em { color:var(--red); font-style:normal; }

.summary-note {
  font-size:11px; color:var(--text-muted); line-height:1.5;
  border-top:1px solid var(--border); padding-top:14px; margin-top:14px;
}

/* CTA */
.cta-row { display:flex; gap:8px; margin-top:16px; }
.btn-primary {
  flex:1; background:var(--red); color:white;
  font-family:'DM Mono',monospace; font-size:12px; letter-spacing:0.5px;
  border:none; border-radius:7px; padding:11px; cursor:pointer;
  transition:all 0.2s; text-align:center;
}
.btn-primary:hover { background:var(--red-hover); }
.btn-secondary {
  background:transparent; border:1px solid var(--border); color:var(--text-muted);
  font-family:'DM Mono',monospace; font-size:12px; letter-spacing:0.5px;
  border-radius:7px; padding:11px 14px; cursor:pointer; transition:all 0.2s;
}
.btn-secondary:hover { border-color:var(--text-muted); color:var(--text); }

/* ── EMPTY STATE ── */
.empty-msg {
  font-family:'DM Mono',monospace; font-size:11px; color:var(--text-muted);
  text-align:center; padding:20px 0; letter-spacing:0.5px;
}

/* Tooltip */
.tip { position:relative; }
.tip-icon { font-family:'DM Mono',monospace; font-size:10px; color:var(--text-muted); cursor:help; }

/* ── PRINT / PDF STYLES ── */
@media print {
  body { background:white !important; color:#111 !important; }
  body::before { display:none; }
  .wrap { max-width:100%; padding:20px; }
  .topbar { border-bottom:1px solid #ddd; margin-bottom:24px; }
  .logo span { color:#E54424; }
  .hero h1 em { color:#E54424; }
  .hero p { color:#333; }
  .layout { grid-template-columns:1fr 320px; gap:24px; }
  .btn-primary, .btn-secondary, .reset-btn, .cta-row { display:none !important; }
  .summary { position:static; background:white; border:1px solid #ddd; break-inside:avoid; }
  .summary::before { background:#E54424; }
  .summary-customer { color:#E54424; }
  .summary-lines { border-top:1px solid #ddd; }
  .summary-line { color:#333; border-bottom:1px solid #eee; }
  .summary-line.drift-line { color:#B45309; }
  .summary-note { color:#666; border-top:1px solid #ddd; }
  .total-monthly { background:#FEF2F2; border:1px solid #E54424; }
  .total-monthly .tl { color:#111; }
  .total-monthly .tv { color:#111; }
  .total-monthly .tv span { color:#666; }
  .section { animation:none; }
  .summary { animation:none; }
  .item-card { background:white; border:1px solid #ddd; }
  .item-card.active { background:#FEF2F2; border-color:#E54424; }
  .item-name { color:#111; }
  .item-desc { color:#666; }
  .item-price { color:#333; }
  .drift-card { background:white; border:1px solid #ddd; break-inside:avoid; }
  .drift-card.selected { background:#FEF2F2; border-color:#E54424; }
  .drift-name { color:#111; }
  .drift-base { color:#111; }
  .section-label { color:#666; }
  .section-label::after { background:#ddd; }
  .customer-bar { display:none; }
  .input-group input { border:1px solid #ddd; background:white; color:#111; }
  .total-label { color:#666; }
  .total-onetime .tl { color:#333; }
  .total-onetime .tv { color:#111; }
  .per-day { color:#666; }
  .per-day em { color:#E54424; }
  /* Konfidensialitetsmerke */
  .wrap::after {
    content:'PRISESTIMAT — IKKE BINDENDE';
    position:fixed; bottom:10mm; right:10mm;
    font-family:'DM Mono',monospace; font-size:8px;
    color:#999; letter-spacing:1px;
  }
}

/* ── RESPONSIVE ── */
@media (max-width:760px) {
  .layout { grid-template-columns:1fr; }
  .summary { position:static; }
  .customer-bar { grid-template-columns:1fr 1fr; }
  .customer-bar .reset-btn { grid-column:1/-1; }
  .drift-grid { grid-template-columns:1fr; }
  .item-card { grid-template-columns:20px auto 1fr auto; }
  .item-price-wrap { font-size:11px; }
}

/* Animate in */
@keyframes fadeUp { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:none} }
.section { animation:fadeUp 0.4s ease both; }
.section:nth-child(1){animation-delay:.05s}
.section:nth-child(2){animation-delay:.10s}
.section:nth-child(3){animation-delay:.15s}
.section:nth-child(4){animation-delay:.20s}
.section:nth-child(5){animation-delay:.25s}
.summary { animation:fadeUp 0.4s ease 0.1s both; }

.pulse { animation:pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
