/* Visual language follows paulvloemans.be: white canvas, near-black type,
   signal yellow accent, square buttons, uppercase spaced sans + Garamond body. */

:root {
    --yellow:      #ffcd00;
    --yellow-dark: #e6b800;
    --ink:         #272727;
    --ink-soft:    #3e3e3e;
    --text:        #4a4a4a;
    --muted:       #7a7a7a;
    --line:        #dcdcdc;
    --surface:     #f6f6f6;
    --white:       #ffffff;
    --danger:      #b3261e;

    --sans:  "Montserrat", "proxima-nova", "Helvetica Neue", Arial, sans-serif;
    --serif: "EB Garamond", "adobe-garamond-pro", Garamond, Georgia, serif;

    --gutter: 16px;
    --ease:   cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--white);
    color: var(--text);
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.6;
}

/* Avoid a flash of the empty layout while data loads. */
.calc__grid { opacity: 0; transition: opacity .25s var(--ease); }
.is-ready .calc__grid { opacity: 1; }

[hidden] { display: none !important; }

.calc {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px var(--gutter) 48px;
}

/* ---------- Intro ---------- */

.eyebrow {
    margin: 0 0 8px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink);
}
.eyebrow::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 3px;
    margin-right: 10px;
    vertical-align: middle;
    background: var(--yellow);
}
.eyebrow--light { color: rgba(255, 255, 255, .7); }

.calc__intro { margin-bottom: 32px; }

h1 {
    margin: 0 0 8px;
    font-family: var(--sans);
    font-size: clamp(26px, 5vw, 38px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ink);
}

.lead { margin: 0; max-width: 56ch; font-size: 19px; }

/* ---------- Layout ---------- */

.calc__grid {
    display: grid;
    gap: 32px;
}

@media (min-width: 900px) {
    .calc__grid {
        grid-template-columns: minmax(0, 1fr) 380px;
        gap: 48px;
        align-items: start;
    }
    .result { position: sticky; top: 24px; }
    .mini { display: none !important; }
}

/* ---------- Field groups ---------- */

.field-group {
    padding: 24px 0;
    border-top: 1px solid var(--line);
}
.field-group:first-child { border-top: 0; padding-top: 0; }

.field-group__title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink);
}

.step {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: none;
    background: var(--yellow);
    color: var(--ink);
    font-size: 13px;
    letter-spacing: 0;
}

.field-group__lead { margin: -8px 0 16px; font-size: 17px; color: var(--muted); }

.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }

label, .label, legend {
    display: block;
    margin-bottom: 8px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--ink);
}

legend small {
    display: block;
    margin-top: 2px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--muted);
}

.hint {
    min-height: 1.4em;
    margin: 6px 0 0;
    font-size: 16px;
    color: var(--muted);
}
.hint:empty { min-height: 0; margin: 0; }

input[type="text"],
input[type="number"],
select {
    width: 100%;
    height: 56px;
    padding: 0 16px;
    border: 2px solid var(--line);
    border-radius: 0;
    background: var(--white);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 20px;
    font-weight: 600;
    transition: border-color .15s var(--ease);
    appearance: none;
}
select {
    font-size: 17px;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
    background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
    background-size: 6px 6px;
    background-repeat: no-repeat;
}
input::placeholder { color: #b5b5b5; font-weight: 500; }
input:hover, select:hover { border-color: #bdbdbd; }
input:focus, select:focus { outline: none; border-color: var(--ink); }
input.is-valid { border-color: var(--ink); }
input.is-invalid { border-color: var(--danger); }
input.is-invalid + .hint { color: var(--danger); }

input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.field--postcode input { max-width: 200px; letter-spacing: .12em; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* Area */

.area-input { position: relative; max-width: 240px; }
.area-input input { padding-right: 56px; }
.area-input .unit {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    font-family: var(--sans);
    font-weight: 600;
    color: var(--muted);
    pointer-events: none;
}
.area-input--small { max-width: 180px; margin-top: 12px; }
.area-input--small input { height: 48px; font-size: 18px; }

.range {
    --fill: 0%;
    width: 100%;
    height: 32px;
    margin: 16px 0 0;
    background: transparent;
    appearance: none;
    cursor: pointer;
}
.range::-webkit-slider-runnable-track {
    height: 6px;
    background: linear-gradient(to right, var(--ink) var(--fill), var(--line) var(--fill));
}
.range::-moz-range-track { height: 6px; background: var(--line); }
.range::-moz-range-progress { height: 6px; background: var(--ink); }
.range::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
    margin-top: -11px;
    border: 3px solid var(--ink);
    border-radius: 50%;
    background: var(--yellow);
    appearance: none;
    transition: transform .15s var(--ease);
}
.range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border: 3px solid var(--ink);
    border-radius: 50%;
    background: var(--yellow);
}
.range:active::-webkit-slider-thumb { transform: scale(1.15); }
.range:focus-visible { outline-offset: 4px; }

.range-scale {
    display: flex;
    justify-content: space-between;
    font-family: var(--sans);
    font-size: 11px;
    letter-spacing: .06em;
    color: var(--muted);
}

/* Thickness */

.thickness {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
}

.stepper {
    display: inline-flex;
    border: 2px solid var(--ink);
}
.stepper__btn {
    width: 52px;
    height: 52px;
    border: 0;
    background: var(--white);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 24px;
    cursor: pointer;
    transition: background .15s var(--ease);
}
.stepper__btn:hover:not(:disabled) { background: var(--surface); }
.stepper__btn:active:not(:disabled) { background: var(--yellow); }
.stepper__btn:disabled { color: #c4c4c4; cursor: not-allowed; }
.stepper__value {
    display: grid;
    place-items: center;
    min-width: 92px;
    border-inline: 2px solid var(--ink);
    font-family: var(--sans);
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
}
.stepper__value.is-default { color: var(--muted); }

.check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    min-height: 44px;
    font-weight: 500;
    cursor: pointer;
}
.check input {
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--ink);
}

/* Floor cross-section */

.floor {
    --chape: 40px;
    position: relative;
    display: flex;
    align-items: flex-end;
    height: 150px;
    margin: 20px 0 0;
    overflow: hidden;
    background: linear-gradient(to bottom, var(--surface), var(--white));
}
.floor__wall {
    position: absolute;
    inset: 0 auto 0 0;
    width: 28px;
    background:
        repeating-linear-gradient(to bottom, transparent 0 17px, rgba(0, 0, 0, .12) 17px 19px),
        #c98b6b;
}
.floor__edge {
    position: absolute;
    bottom: 34px;
    left: 28px;
    width: 6px;
    height: calc(var(--chape) + 10px);
    background: var(--yellow);
    transition: height .35s var(--ease), opacity .25s var(--ease);
}
.floor__layers {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding-left: 34px;
}
.floor__chape {
    position: relative;
    height: var(--chape);
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, .25) 0 1px, transparent 2px) 0 0 / 14px 14px,
        linear-gradient(to bottom, #b9b6b0, #a19d96);
    transition: height .35s var(--ease);
}
.floor__foil {
    position: relative;
    height: 4px;
    background: #5f87a3;
    transition: opacity .25s var(--ease);
}
.floor__base {
    height: 30px;
    background: repeating-linear-gradient(135deg, #8b8b8b 0 2px, #d3d3d3 2px 9px);
}
.floor__tag {
    position: absolute;
    right: 10px;
    bottom: 50%;
    transform: translateY(50%);
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink);
    white-space: nowrap;
}
.floor__tag--small {
    bottom: auto;
    top: 6px;
    transform: none;
    font-size: 10px;
    color: var(--white);
    background: #5f87a3;
    padding: 1px 6px;
}
.floor.no-foil .floor__foil { opacity: 0; }
.floor.no-edge .floor__edge { opacity: 0; }

/* Choices */

.choice {
    margin: 0 0 20px;
    padding: 0;
    border: 0;
}
.choice:last-child { margin-bottom: 0; }

.segmented {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 2px solid var(--ink);
}
.segmented--two { grid-template-columns: repeat(2, 1fr); max-width: 260px; }
.segmented label { position: relative; margin: 0; }
.segmented label + label span { border-left: 2px solid var(--ink); }
.segmented input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.segmented span {
    display: grid;
    place-items: center;
    height: 48px;
    padding: 0 6px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .03em;
    text-align: center;
    line-height: 1.2;
    color: var(--ink);
    background: var(--white);
    transition: background .15s var(--ease), color .15s var(--ease);
}
.segmented label:hover input:not(:checked) + span { background: var(--surface); }
.segmented input:checked + span { background: var(--ink); color: var(--white); }
.segmented input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: -5px; }

.perimeter { margin-top: 10px; }
.perimeter summary {
    display: inline-block;
    min-height: 32px;
    padding-top: 4px;
    font-size: 16px;
    color: var(--ink-soft);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.perimeter summary::-webkit-details-marker { display: none; }

/* Notices */

.notice {
    margin-top: 16px;
    padding: 14px 16px;
    border-left: 4px solid var(--yellow);
    background: #fff8d9;
    font-size: 17px;
    line-height: 1.5;
    color: var(--ink);
}
.notice strong { font-family: var(--sans); font-size: 14px; display: block; margin-bottom: 2px; }
.notice--dark {
    margin: 0 0 20px;
    background: rgba(255, 205, 0, .12);
    color: var(--white);
}
.notice--dark strong { display: inline; }

/* Mobile price strip */

.mini {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    padding: 14px 16px;
    background: var(--ink);
    color: var(--white);
    text-decoration: none;
    animation: rise .35s var(--ease);
}
.mini__label {
    white-space: nowrap;
    font-family: var(--sans);
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .7);
}
.mini__price {
    flex: 1;
    font-family: var(--sans);
    font-size: 17px;
    font-weight: 700;
    color: var(--yellow);
    white-space: nowrap;
}
.mini__more { font-family: var(--sans); font-size: 12px; }

/* ---------- Result card ---------- */

.result {
    padding: 28px 24px;
    background: var(--ink);
    color: rgba(255, 255, 255, .85);
    scroll-margin-top: 16px;
}

.result__state { animation: rise .35s var(--ease); }

.result__placeholder {
    margin: 0 0 16px;
    font-family: var(--sans);
    font-size: 34px;
    font-weight: 700;
    color: rgba(255, 255, 255, .25);
}

.todo { margin: 0; padding: 0; list-style: none; }
.todo li {
    position: relative;
    padding: 6px 0 6px 30px;
    font-size: 17px;
}
.todo li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 11px;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .4);
}
.todo li.is-done { color: rgba(255, 255, 255, .45); text-decoration: line-through; }
.todo li.is-done::before { border-color: var(--yellow); background: var(--yellow); }

.result__price {
    margin: 0;
    font-family: var(--sans);
    font-size: clamp(28px, 8vw, 34px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.01em;
    color: var(--yellow);
    font-variant-numeric: tabular-nums;
}
.result__price span { white-space: nowrap; }
.result__price .dash { color: rgba(255, 255, 255, .5); font-weight: 500; }

.result__vat {
    margin: 8px 0 0;
    font-family: var(--sans);
    font-size: 13px;
    letter-spacing: .02em;
    color: rgba(255, 255, 255, .75);
}

.result__disclaimer {
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .15);
    font-size: 15px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .7);
}

.result__subtitle {
    margin: 22px 0 10px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--white);
}

.included { margin: 0 0 24px; padding: 0; list-style: none; }
.included li {
    position: relative;
    padding: 4px 0 4px 26px;
    font-size: 16px;
    line-height: 1.4;
}
.included li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 9px;
    width: 12px;
    height: 7px;
    border-left: 2px solid var(--yellow);
    border-bottom: 2px solid var(--yellow);
    transform: rotate(-45deg);
}

.result__custom {
    margin: 0;
    font-family: var(--sans);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--yellow);
}

.result__small {
    margin: 12px 0 0;
    font-size: 15px;
    text-align: center;
    color: rgba(255, 255, 255, .6);
}
.result__small a { color: var(--white); }

.button {
    display: block;
    padding: 18px 20px;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .12em;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    transition: background .15s var(--ease), transform .15s var(--ease);
}
.button--accent { background: var(--yellow); color: var(--ink); }
.button--accent:hover { background: var(--yellow-dark); }
.button--accent:active { transform: translateY(1px); }
.result__state[data-state="custom"] .button { margin-top: 24px; }

.calc__error {
    padding: 16px;
    border-left: 4px solid var(--danger);
    background: #fbeaea;
}
.calc__error a { color: var(--ink); }

@keyframes rise {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 1ms !important;
        transition-duration: 1ms !important;
    }
}

/* Embedded in an iframe: drop the outer padding a bit. */
.is-embedded .calc { padding-top: 8px; }
