/* ============================================================
   TimeInvest — Partner-beregner brand stylesheet
   Montserrat + brandets jordfarvepalette (lys/varm retning)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700&display=swap');

:root {
    /* Brand palette (fra brand kit) */
    --ti-slate:        #465758; /* primær mørk slate-teal */
    --ti-slate-700:    #5f7174; /* medium slate */
    --ti-slate-900:    #3a4849; /* hover/mørkere */
    --ti-brown:        #8b5e3c;
    --ti-taupe:        #867763;
    --ti-sage:         #7a8b74;
    --ti-tan:          #e5d5c3;
    --ti-cream:        #ece0d2;
    --ti-cream-deep:   #f0e7da;
    --ti-paper:        #f7f6f2;
    --ti-white:        #ffffff;

    /* Tekst */
    --ink:        #2d3839;
    --ink-soft:   #5f6b6c;
    --ink-faint:  #8a9293;

    /* Form */
    --radius:      14px;
    --radius-sm:   10px;
    --line:        #e7e2d9;
    --shadow-sm:   0 1px 2px rgba(70,87,88,.04), 0 1px 3px rgba(70,87,88,.06);
    --shadow:      0 4px 14px rgba(70,87,88,.07), 0 1px 3px rgba(70,87,88,.05);
    --shadow-lg:   0 18px 40px -12px rgba(70,87,88,.22);

    font-synthesis: none;
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
    margin: 0;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    color: var(--ink);
    background-color: var(--ti-paper);
    background-image:
        radial-gradient(1200px 600px at 88% -8%, rgba(229,213,195,.45), transparent 60%),
        radial-gradient(900px 500px at 0% 100%, rgba(236,224,210,.4), transparent 55%);
    background-attachment: fixed;
    line-height: 1.5;
}

/* ---------- Layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

/* ---------- Header ---------- */
.site-header {
    border-bottom: 1px solid var(--line);
    background: rgba(247,246,242,.78);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 20;
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 28px;
    max-width: 1120px;
    margin: 0 auto;
}
.site-header__logo { height: 30px; width: auto; display: block; }
.site-header__tag {
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ti-taupe);
    white-space: nowrap;
}

/* ---------- Page hero ---------- */
.hero { padding: 48px 0 8px; }
.hero__eyebrow {
    font-size: 12.5px; font-weight: 600; letter-spacing: .18em;
    text-transform: uppercase; color: var(--ti-brown); margin: 0 0 14px;
}
.hero h1 {
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 600;
    letter-spacing: -.015em;
    line-height: 1.08;
    color: var(--ti-slate);
    margin: 0 0 14px;
}
.hero p {
    font-size: 17px; font-weight: 400; color: var(--ink-soft);
    max-width: 60ch; margin: 0; text-wrap: pretty;
}

/* ---------- Section ---------- */
.section { padding: 40px 0; }
.section + .section { padding-top: 8px; }
.section__head { display: flex; align-items: baseline; gap: 14px; margin: 0 0 22px; }
.section__head h2 {
    font-size: 22px; font-weight: 600; letter-spacing: -.01em;
    color: var(--ti-slate); margin: 0;
}
.section__num {
    font-size: 13px; font-weight: 600; color: var(--ti-white);
    background: var(--ti-slate); width: 26px; height: 26px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.section__hint { font-size: 13.5px; color: var(--ink-faint); margin-left: auto; }

/* ---------- Card ---------- */
.card {
    background: var(--ti-white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}

/* ---------- Form controls ---------- */
.grid { display: grid; gap: 22px 26px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--5 { grid-template-columns: repeat(5, 1fr); }

.field { display: flex; flex-direction: column; gap: 9px; }
.field__label {
    font-size: 13px; font-weight: 500; color: var(--ink-soft);
    display: flex; align-items: center; gap: 7px;
}
.field__label .unit { color: var(--ink-faint); font-weight: 400; }

.num-input {
    width: 100%;
    font-family: inherit;
    font-size: 16px; font-weight: 500;
    color: var(--ink);
    background: var(--ti-paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.num-input:focus {
    outline: none;
    background: var(--ti-white);
    border-color: var(--ti-slate-700);
    box-shadow: 0 0 0 3px rgba(95,113,116,.16);
}

/* Slider */
.slider-row { display: flex; align-items: center; gap: 14px; }
.slider-val {
    font-size: 16px; font-weight: 600; color: var(--ti-slate);
    min-width: 56px; text-align: right; font-variant-numeric: tabular-nums;
}
input[type="range"] {
    -webkit-appearance: none; appearance: none;
    flex: 1; height: 6px; border-radius: 999px;
    background: var(--ti-tan);
    cursor: pointer; margin: 8px 0;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    height: 20px; width: 20px; border-radius: 50%;
    background: var(--ti-slate);
    border: 3px solid var(--ti-white);
    box-shadow: 0 1px 4px rgba(70,87,88,.35);
    cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
    height: 20px; width: 20px; border-radius: 50%;
    background: var(--ti-slate);
    border: 3px solid var(--ti-white);
    box-shadow: 0 1px 4px rgba(70,87,88,.35);
    cursor: pointer;
}
input[type="range"]:focus-visible { outline: 2px solid var(--ti-slate-700); outline-offset: 4px; }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat {
    background: var(--ti-white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 22px 24px;
    position: relative;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}
.stat::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: var(--accent, var(--ti-slate));
}
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat__label {
    font-size: 13px; font-weight: 500; color: var(--ink-soft);
    margin: 0 0 12px; display: flex; align-items: center; gap: 8px;
}
.stat__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent, var(--ti-slate)); flex: none; }
.stat__value {
    font-size: 27px; font-weight: 600; letter-spacing: -.02em;
    color: var(--ti-slate); margin: 0; font-variant-numeric: tabular-nums;
}
.stat__sub { font-size: 12.5px; color: var(--ink-faint); margin: 6px 0 0; }

/* Hero stat (emphasised) */
.stat--hero { background: var(--ti-slate); border-color: var(--ti-slate); }
.stat--hero::before { background: var(--ti-tan); }
.stat--hero .stat__label { color: rgba(255,255,255,.72); }
.stat--hero .stat__value { color: var(--ti-white); }
.stat--hero .stat__sub { color: rgba(255,255,255,.6); }
.stat--hero .stat__dot { background: var(--ti-tan); }

/* ---------- Pristrappe (progressiv bar + specifikation) ---------- */
.ladder-bar {
    display: flex; width: 100%; height: 52px;
    border-radius: var(--radius-sm); overflow: hidden;
    background: var(--ti-paper); margin-bottom: 26px; gap: 2px;
}
.ladder-seg {
    display: flex; align-items: center; justify-content: center;
    min-width: 0; transition: width .4s ease;
}
.ladder-seg__lbl {
    font-size: 13px; font-weight: 600; color: var(--ti-white);
    text-shadow: 0 1px 2px rgba(0,0,0,.18); white-space: nowrap;
}
.ladder-empty { margin: auto; font-size: 13px; color: var(--ink-faint); }

table.ladder-table tbody td:first-child {
    color: var(--ink-soft); font-weight: 500;
    display: flex; align-items: center; gap: 10px;
}
.swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; }
table.ladder-table tbody tr.is-dim { opacity: .42; }
table.ladder-table tbody tr.is-dim:hover { background: transparent; }
table.ti tbody tr.row-total td {
    border-top: 2px solid var(--line); border-bottom: none;
    padding-top: 17px; font-weight: 600; color: var(--ti-slate); font-size: 15.5px;
}
table.ti tbody tr.row-total:hover { background: transparent; }
table.ti tbody tr.row-total td:first-child { font-weight: 600; }

/* ---------- Table ---------- */
.table-scroll { overflow-x: auto; margin: 0 -4px; }
table.ti { width: 100%; border-collapse: collapse; min-width: 640px; }
table.ti thead th {
    font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--ink-faint); text-align: right; padding: 0 18px 14px; white-space: nowrap;
    border-bottom: 1px solid var(--line);
}
table.ti thead th:first-child { text-align: left; }
table.ti tbody td {
    font-size: 15px; padding: 15px 18px; text-align: right; white-space: nowrap;
    color: var(--ink-soft); font-variant-numeric: tabular-nums;
    border-bottom: 1px solid var(--ti-paper);
}
table.ti tbody td:first-child {
    text-align: left; font-weight: 600; color: var(--ti-slate);
}
table.ti tbody td.col-strong { color: var(--ti-slate); font-weight: 600; }
table.ti tbody tr { transition: background .15s; }
table.ti tbody tr:hover { background: var(--ti-paper); }
.rate-pill {
    display: inline-block; font-size: 12.5px; font-weight: 600;
    color: var(--ti-taupe); background: var(--ti-cream);
    padding: 2px 9px; border-radius: 999px;
}

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; padding: 8px 0 64px; }
.btn {
    font-family: inherit; font-size: 14.5px; font-weight: 500;
    display: inline-flex; align-items: center; gap: 9px;
    padding: 12px 22px; border-radius: var(--radius-sm);
    cursor: pointer; border: 1px solid transparent;
    transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--ti-slate); color: var(--ti-white); }
.btn--primary:hover { background: var(--ti-slate-900); }
.btn--ghost { background: transparent; color: var(--ti-slate); border-color: var(--line); }
.btn--ghost:hover { background: var(--ti-white); border-color: var(--ti-slate-700); }
.btn svg { width: 17px; height: 17px; }

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--line);
    padding: 26px 0 40px;
    font-size: 13px; color: var(--ink-faint);
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

/* ---------- Reveal animation ---------- */
@media (prefers-reduced-motion: no-preference) {
    .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
    .reveal.in { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
    .grid--5 { grid-template-columns: repeat(2, 1fr); }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .tiers { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .wrap { padding: 0 18px; }
    .grid--2, .grid--3, .grid--5, .stats, .tiers { grid-template-columns: 1fr; }
    .section__hint { display: none; }
    .site-header__tag { display: none; }
}
