:root {
  --bg: #0f1419;
  --bg-soft: #161c24;
  --card: #1c2430;
  --card-2: #232d3b;
  --line: #2c3744;
  --text: #e8edf3;
  --muted: #9aa7b6;
  --brand: #ff7a3c;
  --brand-2: #ff9a5c;
  --green: #2fbf71;
  --green-d: #249a5b;
  --vipps: #ff5b24;
  --shadow: 0 12px 40px rgba(0,0,0,.35);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #1d2734 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
a { color: inherit; text-decoration: none; }

/* TOPBAR */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15,20,25,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 600; }
.brand-mark { font-size: 1.4rem; }
.brand strong { color: var(--brand); }
.topnav { display: flex; align-items: center; gap: 22px; font-size: .95rem; color: var(--muted); }
.topnav a:hover { color: var(--text); }
.badge {
  background: rgba(47,191,113,.15); color: var(--green);
  border: 1px solid rgba(47,191,113,.35);
  padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600;
}
.badge.paid { background: rgba(255,122,60,.15); color: var(--brand-2); border-color: rgba(255,122,60,.4); }

/* HERO */
.hero { padding: 64px 0 36px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.lead { color: var(--muted); font-size: 1.15rem; max-width: 620px; margin: 18px auto 28px; }
.lead strong { color: var(--green); }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; border-radius: 12px; padding: 12px 20px;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-primary { background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: #2a1404; box-shadow: 0 8px 24px rgba(255,122,60,.3); }
.btn-primary:hover { box-shadow: 0 10px 30px rgba(255,122,60,.45); }
.btn-secondary { background: var(--card-2); color: var(--text); border-color: var(--line); }
.btn-secondary:hover { background: #2a3645; }
.btn-ghost { background: transparent; color: var(--brand-2); border-color: rgba(255,122,60,.4); }
.btn-ghost:hover { background: rgba(255,122,60,.1); }
.btn-pay-vipps { background: var(--vipps); color: #fff; margin-top: 10px; }
.btn-pay-vipps:hover { filter: brightness(1.08); }

/* CARDS / LAYOUT */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.layout { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.panel { padding: 26px; }
.panel-title { font-size: 1.05rem; font-weight: 700; margin: 22px 0 14px; color: var(--brand-2); }
.panel-title:first-child { margin-top: 0; }

/* FORM */
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.input {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; transition: border .15s ease, box-shadow .15s ease;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,122,60,.18); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa7b6' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 20px; }
.check { display: flex; align-items: center; gap: 9px; font-size: .92rem; color: var(--text); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.field-hint { font-weight: 400; color: var(--muted); font-size: .78rem; }
.fineprint { font-size: .8rem; color: var(--muted); margin-top: 12px; }

/* BUTIKK-INFO */
.stores-info { margin: -4px 0 16px; padding: 14px 16px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; animation: pop .18s ease; }
.stores-info.invalid { border-color: rgba(255,107,107,.4); }
.stores-region { font-size: .9rem; font-weight: 600; margin-bottom: 10px; }
.stores-region .flag { color: var(--green); }
.stores-list { list-style: none; display: grid; gap: 8px; }
.stores-list li { display: flex; align-items: center; justify-content: space-between; font-size: .88rem; }
.store-name { display: flex; align-items: center; gap: 8px; }
.store-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }
.store-dist { color: var(--muted); font-size: .82rem; }
.stores-note { font-size: .76rem; color: var(--muted); margin-top: 10px; }
.fineprint.center { text-align: center; }

/* RESULT */
.result { min-height: 360px; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 320px; text-align: center; color: var(--muted); padding: 20px; }
.empty-emoji { font-size: 3rem; margin-bottom: 14px; }
.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.result-title { font-size: 1.3rem; font-weight: 700; }
.result-sub { color: var(--muted); font-size: .9rem; }
.result-total { text-align: right; }
.result-total-label { display: block; font-size: .78rem; color: var(--muted); }
.result-total-value { display: block; font-size: 1.7rem; font-weight: 800; color: var(--green); }
.table-wrap { overflow-x: auto; }
.mat-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.mat-table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.mat-table td { padding: 11px 10px; border-bottom: 1px solid rgba(44,55,68,.6); }
.mat-table .r { text-align: right; }
.mat-table tr:last-child td { border-bottom: none; }
.mat-name { font-weight: 600; }
.mat-note { display: block; font-size: .78rem; color: var(--muted); }
.result-foot { margin-top: 18px; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* PROJECT */
.project { padding: 24px 26px; margin-top: 22px; }
.project-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.project-grand { font-size: 1.5rem; font-weight: 800; color: var(--green); }
.project-list { list-style: none; }
.project-list li { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.project-list li:last-child { border-bottom: none; }
.project-list .pl-room { font-weight: 600; }
.project-list .pl-sub { font-size: .82rem; color: var(--muted); }
.pl-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .8rem; margin-left: 12px; }
.pl-del:hover { color: #ff6b6b; }

/* HOW */
.how { padding: 56px 0; }
.section-h { text-align: center; font-size: 1.8rem; font-weight: 800; margin-bottom: 32px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.how-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.how-n { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: rgba(255,122,60,.15); color: var(--brand-2); font-weight: 800; margin-bottom: 14px; }
.how-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.how-card p { color: var(--muted); font-size: .95rem; }

/* FOOTER */
.footer { border-top: 1px solid var(--line); padding: 28px 0; text-align: center; color: var(--muted); font-size: .85rem; margin-top: 40px; }

/* hidden-attributtet skal alltid vinne over display-regler under */
[hidden] { display: none !important; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(5,8,12,.7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 36px 32px; max-width: 420px; width: 100%; text-align: center; box-shadow: var(--shadow); animation: pop .2s ease; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-x { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--muted); font-size: 1.6rem; cursor: pointer; line-height: 1; }
.modal-x:hover { color: var(--text); }
.pay-icon { font-size: 2.6rem; margin-bottom: 8px; }
.modal h2 { font-size: 1.4rem; margin-bottom: 10px; }
.pay-text { color: var(--muted); margin-bottom: 18px; }
.pay-text strong { color: var(--brand-2); }
.pay-perks { list-style: none; text-align: left; max-width: 260px; margin: 0 auto 22px; display: grid; gap: 8px; }
.pay-perks li { color: var(--text); }

/* RESPONSIVE */
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .topnav a { display: none; }
}
@media (max-width: 480px) {
  .grid-3 { grid-template-columns: 1fr; }
  .checks { grid-template-columns: 1fr; }
}

/* PRINT */
@media print {
  .topbar, .hero, .how, .footer, #calcForm, .result-actions, .modal-overlay { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  .layout { display: block; }
}
