/* Heirson app: shared tokens and components for the client pages (order form, payment, order page)
   and the admin panels. Tokens match docs/BRAND.md and the public site.
   Type scale: 13 (meta only) / 14 (labels, chips) / 16 (UI) / 17 (body) / 19 / 22 / 28 / 36 / 44 */
:root {
  --ink: #10231A; --ink-2: #2A3B32; --ink-3: #1B3328; --ink-4: #2E4A3D;
  --signal: #12A150; --signal-deep: #0B7A3B; --lime: #C9F24B; --lime-soft: #EEF9CF; --lime-mid: #DDF39A;
  --grad: linear-gradient(135deg, #C9F24B 0%, #12A150 100%); /* kept for the admin panels; client pages use solid marks */
  --paper: #F7F7F2; --paper-2: #EFF0E9; --white: #FFFFFF; --line: #E3E5DE; --line-2: #CDD2CA; --muted: #56605A; --muted-dark: #9FB2A8;
  --danger: #B42318; --danger-ink: #8E2A17; --danger-soft: #FDECEA; --danger-line: #EDB8AD;
  --warn: #9A6B00; --warn-ink: #6B4E00; --warn-soft: #FFF6D6; --warn-line: #EBD58E;
  --info: #1D4E89; --info-soft: #EAF2FF; --info-line: #BBD0EC;
  --head: "Schibsted Grotesk", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 0 rgba(16,35,26,.04), 0 24px 60px -30px rgba(16,35,26,.35);
  --lift: 5px 5px 0 var(--lime);
  --r: 14px; --r-lg: 18px;
  --ease: cubic-bezier(.2,.7,.2,1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
body.cl { font-size: 17px; line-height: 1.6; overflow-x: hidden; }
a { color: var(--signal-deep); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 700; letter-spacing: -0.025em; line-height: 1.12; margin: 0; }
p { margin: 0 0 12px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.ph { border-bottom: 1.5px dashed #B9A24A; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }

.proto { background: var(--ink); color: #C3CEC7; font-size: 13px; text-align: center; padding: 7px 12px; }
.proto b { color: var(--lime); font-weight: 600; }

/* ---------- Eyebrow: the square marker used on the public site ---------- */
.eyebrow { font: 600 13px/1.2 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--signal-deep); display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.eyebrow::before { content: ""; width: 9px; height: 9px; background: var(--signal); flex: none; }
.on-dark .eyebrow { color: var(--lime); }
.on-dark .eyebrow::before { background: var(--lime); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; font: 600 16px/1.2 var(--body); text-decoration: none; text-align: center; padding: 13px 22px; border-radius: 11px; border: 1.5px solid transparent; cursor: pointer; transition: transform .15s, background .15s, border-color .15s, box-shadow .15s, opacity .15s; background: none; color: var(--ink); }
.btn:hover { transform: translateY(-1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; flex: none; transition: transform .2s var(--ease); }
.btn:hover:not(:disabled) svg.go { transform: translateX(3px); }
.btn-primary { background: var(--signal-deep); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #096733; color: #fff; }
.btn-ghost { border-color: var(--line-2); background: var(--white); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover:not(:disabled) { background: var(--ink-3); color: #fff; }
.btn-lime { background: var(--lime); color: var(--ink); }
.btn-lime:hover:not(:disabled) { background: #D8F870; color: var(--ink); }
.btn-link { min-height: 44px; padding: 0 2px; border: 0; color: var(--signal-deep); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.btn-link:hover { transform: none; color: var(--ink); }
.btn.sm { min-height: 44px; padding: 10px 16px; font-size: 15px; }
.btn.lg { min-height: 56px; padding: 16px 26px; font-size: 17px; }
.btn.wide { width: 100%; }
.on-dark .btn-ghost { background: transparent; color: #fff; border-color: #4E6B5D; }
.on-dark .btn-ghost:hover { border-color: var(--lime); color: #fff; }

/* ---------- Fields ---------- */
.field { margin-bottom: 22px; min-width: 0; }
.field > label, .field .lab { display: block; font: 600 15px/1.35 var(--body); margin-bottom: 8px; color: var(--ink); }
.field .opt-l { font-weight: 500; color: var(--muted); }
.field .hint { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 8px 0 0; }
.input, select.input, textarea.input { width: 100%; min-height: 52px; font: 500 17px/1.35 var(--body); color: var(--ink); padding: 13px 15px; border: 1.5px solid var(--line-2); border-radius: 11px; background: var(--white); transition: border-color .15s, box-shadow .15s; }
textarea.input { line-height: 1.55; }
.input::placeholder { color: #8A938D; }
.input:hover { border-color: #AEB6AC; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(201,242,75,.65); }
.input.err { border-color: var(--danger); }
.err-msg { display: none; align-items: flex-start; gap: 8px; color: var(--danger); font: 500 14px/1.45 var(--body); margin-top: 8px; }
.err-msg::before { content: "!"; flex: none; width: 18px; height: 18px; display: grid; place-items: center; background: var(--danger); color: #fff; font: 700 12px/1 var(--body); margin-top: 1px; }
.field.has-err .err-msg { display: flex; }
.field.has-err .input, .field.has-err .hss-btn { border-color: var(--danger); background: #FFFBFA; }
.field.is-ok .input { border-color: #9FCDAF; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }

/* Native select fallback (only seen before hs-select loads, or with data-native) */
.select { position: relative; }
.select::after { content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select select { -webkit-appearance: none; -moz-appearance: none; appearance: none; padding-right: 44px; cursor: pointer; }
.select select::-ms-expand { display: none; }
/* Once hs-select takes over, its own chevron is the only arrow */
.select:has(.hss)::after, .select.has-hss::after { display: none; }
/* hs-select inside a form field matches the inputs */
.field .hss, .form .hss { font: 500 17px/1.3 var(--body); }
.field .hss-btn, .form .hss-btn { min-height: 52px; border: 1.5px solid var(--line-2); border-radius: 11px; padding: 12px 12px 12px 15px; }
.field .hss-btn:hover, .form .hss-btn:hover { border-color: var(--ink); box-shadow: none; transform: none; }
.field .hss-btn:focus-visible, .form .hss-btn:focus-visible { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(201,242,75,.65); }
.field .hss.open .hss-btn { border-color: var(--ink); }
.field .hss-btn .hss-chev { width: 26px; height: 26px; border-radius: 6px; }
.field .hss-list { font-size: 16px; max-width: min(420px, calc(100vw - 32px)); }
.field .hss-list li { min-height: 44px; }

/* Checkbox with the square brand mark */
.check { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; font-size: 16px; line-height: 1.5; min-height: 44px; }
.check input, .tick { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; border: 2px solid var(--ink); flex: none; margin: 0; cursor: pointer; display: grid; place-items: center; background: #fff; border-radius: 3px; transition: background .15s, border-color .15s; }
.check input:checked, .tick:checked { background: var(--lime); border-color: var(--ink); }
.check input:checked::after, .tick:checked::after { content: ""; width: 11px; height: 6px; border-left: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: rotate(-45deg) translate(1px, -1px); }
.check input:focus-visible, .tick:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

.choice { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; text-align: left; font: inherit; color: var(--ink); background: var(--white); border: 1.5px solid var(--line); border-radius: var(--r); padding: 16px 18px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.choice:hover { border-color: #AEB6AC; }
.choice[aria-checked="true"], .choice[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice .fi { width: 34px; height: 25px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); background-size: cover; flex: none; }
.choice b { display: block; font: 600 16px/1.25 var(--head); }
.choice small { color: var(--muted); font-size: 14px; }
.choice .tag { margin-left: auto; font: 600 13px/1 var(--body); padding: 6px 9px; border-radius: 6px; background: var(--lime-soft); color: var(--signal-deep); white-space: nowrap; }

/* ---------- Cards ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.card h2 { font-size: 24px; letter-spacing: -0.02em; }
.card h3 { font-size: 19px; letter-spacing: -0.015em; }
.card .sub { color: var(--ink-2); font-size: 16px; line-height: 1.55; margin: 6px 0 20px; }
.card-ink { background: var(--ink); color: #C3CEC7; border-color: var(--ink); }
.card-ink h2, .card-ink h3 { color: #fff; }

/* ---------- Notes and alerts ---------- */
.note { display: flex; gap: 12px; padding: 15px 18px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.note::before { content: ""; width: 10px; height: 10px; background: var(--signal); flex: none; margin-top: 7px; }
.note.warn { background: var(--warn-soft); border-color: var(--warn-line); }
.note.warn::before { background: #C9A227; }
.alert { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 4px 14px; align-items: start; padding: 18px 20px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--white); font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.alert::before { content: ""; grid-row: 1 / span 3; width: 26px; height: 26px; background: var(--signal) center/14px no-repeat; }
.alert > * { grid-column: 2; margin: 0; }
.alert b, .alert .t { display: block; font: 700 17px/1.3 var(--head); color: var(--ink); }
.alert.ok { background: var(--lime-soft); border-color: #C9E58A; }
.alert.info { background: var(--info-soft); border-color: var(--info-line); }
.alert.info::before { background-color: var(--info); }
.alert.warn { background: var(--warn-soft); border-color: var(--warn-line); }
.alert.warn::before { background-color: #C9A227; }
.alert.bad { background: var(--danger-soft); border-color: var(--danger-line); }
.alert.bad::before { background-color: var(--danger); }

/* ---------- Status pills and chips ---------- */
.status { display: inline-flex; align-items: center; gap: 8px; font: 600 14px/1 var(--body); padding: 8px 11px; border-radius: 7px; letter-spacing: .01em; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; background: currentColor; flex: none; }
.status.ok { background: var(--lime-soft); color: var(--signal-deep); }
.status.run { background: var(--info-soft); color: var(--info); }
.status.run::before { animation: blink 1.2s steps(2) infinite; }
.status.wait { background: #F1F2EE; color: var(--muted); }
.status.ext { background: var(--warn-soft); color: var(--warn-ink); }
.status.bad { background: var(--danger-soft); color: var(--danger-ink); }
.chip { display: inline-flex; align-items: center; gap: 7px; font: 600 14px/1 var(--body); padding: 7px 10px; border-radius: 7px; white-space: nowrap; background: #F1F2EE; color: var(--ink-2); }
.chip::before { content: ""; width: 7px; height: 7px; background: currentColor; flex: none; }

/* ---------- Key and value lists (receipts) ---------- */
.rows { margin: 0; display: grid; }
.rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 16px; }
.rows > div:first-child { border-top: 0; }
.rows dt, .rows .k { color: var(--muted); }
.rows dd, .rows .v { margin: 0; color: var(--ink); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.rows .tot { border-top: 2px solid var(--ink); font: 700 19px/1.25 var(--head); }
.rows .tot .k, .rows .tot dt { color: var(--ink); }

/* ---------- Vertical timeline ---------- */
.tl { list-style: none; margin: 0; padding: 0; }
.tl > li { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 16px; padding-bottom: 22px; }
.tl > li:last-child { padding-bottom: 0; }
.tl > li::before { content: ""; position: absolute; left: 12px; top: 28px; bottom: 2px; width: 2px; background: var(--line); }
.tl > li:last-child::before { display: none; }
.tl .mk { position: relative; z-index: 1; width: 26px; height: 26px; border: 2px solid var(--line-2); background: var(--white); display: grid; place-items: center; }
.tl li.done::before { background: var(--signal); }
.tl li.done .mk { background: var(--lime); border-color: var(--ink); }
.tl li.done .mk::after { content: ""; width: 10px; height: 5px; border-left: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: rotate(-45deg) translate(1px, -1px); }
.tl li.now .mk { border-color: var(--ink); }
.tl li.now .mk::after { content: ""; width: 10px; height: 10px; background: var(--ink); animation: blink 1.4s steps(2) infinite; }
.tl b { display: block; font: 600 17px/1.35 var(--head); color: var(--ink); }
.tl small { display: block; color: var(--ink-2); font-size: 15px; line-height: 1.5; margin-top: 3px; }
.tl em { display: inline-block; font-style: normal; font: 600 14px/1.3 var(--body); color: var(--muted); margin-top: 6px; }
.tl li.done em { color: var(--signal-deep); }
.tl li.now em { color: var(--ink); }

@keyframes blink { 50% { opacity: .25; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.dark { border-color: rgba(16,35,26,.15); border-top-color: var(--ink); }

@media (max-width: 620px) {
  .card { padding: 22px 18px; border-radius: 16px; }
  .card h2 { font-size: 22px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .alert { padding: 16px; grid-template-columns: 22px minmax(0, 1fr); gap: 4px 12px; }
  .alert::before { width: 22px; height: 22px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
