/* Printquote: tokens, base type, page skeleton, buttons, forms.
   Data lists live in app.css, marketing pages in info.css.
   Colour's job is identity: --brand marks the wordmark and primary actions only. */

@font-face {
  font-family: "Plex Serif";
  src: url("../fonts/ibm-plex-serif-700.e0a76bff792a.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plex Sans";
  src: url("../fonts/ibm-plex-sans-400.9ada11705e36.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Sans";
  src: url("../fonts/ibm-plex-sans-600.58896be0520f.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* colour roles */
  --ground: #ffffff;
  --surface: #f1f4f4;
  --ink: #1b2024;
  --muted: #565f67;
  --rule: #d3d9dc;
  --rule-strong: #7f8990;
  --brand: #0b5c57;
  --brand-deep: #073f3c;
  --brand-tint: #e2efed;
  --on-brand: #ffffff;
  --error: #a1261c;
  --error-tint: #fbeceb;

  /* type: display face for titles, wordmark and prices; Plex Sans for the rest (system sans fallback) */
  --font-display: "Plex Serif", Georgia, "Times New Roman", serif;
  --font-body: "Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --step--1: 0.875rem;  /* 14 */
  --step-0: 1rem;       /* 16 */
  --step-1: 1.25rem;    /* 20 */
  --step-2: 1.5625rem;  /* 25 */
  --step-3: 1.953rem;   /* 31 */
  --step-4: 2.441rem;   /* 39 */
  --step-5: 3.052rem;   /* 49 */
  --leading: 1.55;
  --leading-tight: 1.15;
  --measure: 38rem;

  /* space */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;
  --gutter: 1rem;
  --page-max: 72rem;
  --w-form: 34rem;
  --w-list: 44rem;
  --w-card: 22rem;
  --w-deck: 30rem;
  --w-aside: 20rem;
  /* price column: "100,000.00 EUR" at 700 1.25rem Plex Serif measures 155.2px (Playwright), so 10rem = 160px fits */
  --w-price: 10rem;
  --w-field: 13rem;

  --radius: 6px;
  --hairline: 1px;
  --tap: 2.75rem; /* 44 px comfortable target; 24 px is the AA floor */
  --focus: 3px solid var(--brand);
  --speed: 120ms;
}

@media (min-width: 48rem) {
  :root { --gutter: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --speed: 0ms; }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: var(--step-0) / var(--leading) var(--font-body);
  font-synthesis: none;
  overflow-wrap: break-word;
  hyphens: manual; /* long Finnish compounds still break via overflow-wrap */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
h1, h2, h3, h4 { margin: 0 0 var(--s-3); line-height: var(--leading-tight); text-wrap: balance; }
h1, h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); margin-top: var(--s-7); }
h3 { font-size: var(--step-1); font-weight: 600; }
h4 { font-size: var(--step-0); font-weight: 600; }
p, ul, ol, dl { margin: 0 0 var(--s-4); }
b, strong, th, dt, label, legend { font-weight: 600; }
small { font-size: var(--step--1); }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 0.18em; padding-block: 0.2em; }
a:hover { color: var(--brand-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: var(--focus); outline-offset: 2px; border-radius: 2px; }

@media (min-width: 48rem) {
  h1 { font-size: var(--step-4); }
}

/* ---------- skeleton ---------- */
.wrap { width: 100%; max-width: var(--page-max); margin-inline: auto; padding-inline: var(--gutter); }

.site-header { border-bottom: var(--hairline) solid var(--rule); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-5); padding-block: var(--s-3); }

.wordmark {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: var(--tap);
  font: 700 var(--step-1) / 1 var(--font-display);
  color: var(--ink); text-decoration: none;
}
.wordmark:hover { color: var(--ink); }
/* the layer motif: a small part built from four printed layers, widest at the bed */
.layers {
  display: inline-block; width: 1.25rem; height: 1rem;
  background:
    linear-gradient(var(--brand), var(--brand)) 50% 100% / 100% 3px,
    linear-gradient(var(--brand), var(--brand)) 50% 66% / 80% 3px,
    linear-gradient(var(--brand), var(--brand)) 50% 33% / 56% 3px,
    linear-gradient(var(--brand), var(--brand)) 50% 0 / 28% 3px;
  background-repeat: no-repeat;
}

.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-1); margin-left: auto; }
.site-nav a, .site-nav .linklike {
  display: inline-flex; align-items: center; min-height: var(--tap);
  padding: 0 var(--s-2); color: var(--ink); text-decoration: none; font-size: var(--step-0);
}
.site-nav a:hover, .site-nav .linklike:hover { color: var(--brand); text-decoration: underline; }
.site-nav form { display: inline; margin: 0; }
.site-nav .nav-cta { color: var(--brand); font-weight: 600; }
/* phone header: wordmark, one primary link and a no-JS Menu on one row; desktop shows the full nav.
   .phone-nav and the details are display: contents, so the summary and the open panel box
   (::details-content in Chromium/WebKit, .menu-panel elsewhere) are header-row items: the panel
   takes a full row under the bar and pushes the page down. */
.phone-nav { display: none; }
@media (max-width: 47.99rem) {
  .header-row { flex-wrap: wrap; gap: 0 var(--s-2); padding-block: var(--s-2); }
  .header-row .site-nav { display: none; }
  .phone-nav, .nav-menu { display: contents; }
  .phone-primary {
    display: inline-flex; align-items: center; min-height: var(--tap); margin-left: auto;
    padding: 0 var(--s-2); font-size: var(--step--1); font-weight: 600; text-decoration: none;
  }
  .nav-menu summary {
    display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--tap); padding: 0 var(--s-3);
    border: var(--hairline) solid var(--rule-strong); border-radius: var(--radius);
    font-size: var(--step--1); cursor: pointer; list-style: none;
  }
  .nav-menu summary::-webkit-details-marker { display: none; }
  /* decorative chevron: points down when closed, up when open; --speed is 0 under reduced motion */
  .nav-menu summary::after {
    content: ""; width: 0.4rem; height: 0.4rem; border: solid currentColor; border-width: 0 2px 2px 0;
    transform: translateY(-0.1rem) rotate(45deg); transition: transform var(--speed);
  }
  .nav-menu[open] summary::after { transform: translateY(0.1rem) rotate(-135deg); }
  .nav-menu::details-content { flex: 1 0 100%; order: 9; }
  .menu-panel { flex: 1 0 100%; order: 9; display: flex; flex-direction: column; padding-block: var(--s-2); }
  .menu-panel a, .menu-panel .linklike {
    display: flex; align-items: center; min-height: var(--tap); padding: 0 var(--s-2);
    color: var(--ink); text-decoration: none; font-size: var(--step-0);
  }
  .menu-panel form { margin: 0; }
  .menu-panel .linklike { width: 100%; justify-content: flex-start; }
}
/* narrow phones keep the logged-in bar on one row: tighter spacing first, then no layers icon -- English only (v1): a longer translation of "Post a request" would wrap the row (flex-wrap), which is acceptable */
@media (max-width: 22.99rem) {
  .header-row { column-gap: var(--s-1); }
  .phone-primary { padding-inline: var(--s-1); }
  .nav-menu summary { gap: var(--s-1); padding-inline: var(--s-2); }
}
@media (max-width: 21.99rem) {
  .header-row .wordmark .layers { display: none; }
}

.site-main { flex: 1; padding-block: var(--s-6) var(--s-8); }

.page-head { margin-bottom: var(--s-6); max-width: var(--measure); }
.page-head h1 { margin-bottom: var(--s-2); }
.deck { font-size: var(--step-1); line-height: 1.45; color: var(--muted); margin: 0; }
.page-head .status { margin-top: var(--s-2); }
.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--step-1); margin-top: var(--s-6); }
.note { color: var(--muted); font-size: var(--step--1); }

.messages { list-style: none; padding: 0; margin: 0 0 var(--s-5); }
.messages li { padding: var(--s-3) var(--s-4); background: var(--brand-tint); border-left: 4px solid var(--brand); }
.confirm-banner form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }

.site-footer { border-top: var(--hairline) solid var(--rule); background: var(--surface); font-size: var(--step--1); color: var(--muted); }
.footer-row { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); padding-block: var(--s-6); align-items: baseline; }
.footer-row .wordmark { font-size: var(--step-0); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 var(--s-4); list-style: none; padding: 0; margin: 0; }
.footer-links a { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--ink); }
.footer-note { flex-basis: 100%; margin: 0; }

/* ---------- buttons ---------- */
.btn, button, input[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--tap); padding: var(--s-2) var(--s-5);
  font: 600 var(--step-0) / 1.2 var(--font-body);
  border-radius: var(--radius); cursor: pointer; text-align: center; text-decoration: none;
  transition: background-color var(--speed), border-color var(--speed);
  /* default: secondary (outlined) */
  background: var(--ground); color: var(--ink); border: var(--hairline) solid var(--rule-strong);
}
.btn:hover, button:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }
.btn-primary, .form button[type="submit"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn-primary:hover, .form button[type="submit"]:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: var(--on-brand); }
.btn-quiet, .linklike {
  background: none; border: 0; padding-inline: 0; color: var(--brand); font-weight: 400;
  text-decoration: underline; text-underline-offset: 0.18em;
}
.btn-quiet:hover { color: var(--brand-deep); }
.btn-wide { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; margin: var(--s-5) 0; }
.actions form { margin: 0; }

/* ---------- forms (Django as_p markup) ---------- */
.form { max-width: var(--w-form); }
.form p { display: flex; flex-direction: column; gap: var(--s-1); margin-bottom: var(--s-5); }
.form label { font-size: var(--step-0); }
.helptext, .form .helptext { color: var(--muted); font-size: var(--step--1); font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="date"], input[type="file"], input:not([type]), select, textarea {
  width: 100%; min-height: var(--tap); padding: var(--s-2) var(--s-3);
  font: inherit; color: var(--ink); background: var(--ground);
  border: var(--hairline) solid var(--rule-strong); border-radius: var(--radius);
}
input[type="number"], input[type="date"] { font-variant-numeric: tabular-nums; }
textarea { min-height: 7rem; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 1.5rem; height: 1.5rem; margin: 0; accent-color: var(--brand); flex: none; }
.form p:has(> input[type="checkbox"]) { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: var(--s-3); }
.form div:has(> label > input[type="checkbox"]) { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-5); }
.form label:has(> input[type="checkbox"]) { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--tap); font-weight: 400; font-size: var(--step-0); }
.errorlist { list-style: none; margin: 0 0 var(--s-2); padding: var(--s-2) var(--s-3); background: var(--error-tint); color: var(--error); border-left: 4px solid var(--error); font-size: var(--step-0); }
.form-switch { margin-top: var(--s-5); color: var(--muted); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* notices: the same tint + ink look as .messages, for standing states like a paused profile */
.notice { margin: 0 0 var(--s-5); padding: var(--s-3) var(--s-4); background: var(--brand-tint); color: var(--ink); border-left: 4px solid var(--brand); }
.notice--paused { background: var(--surface); border-left-color: var(--rule-strong); }

/* app screens: h1 one step down (step-3) at desktop; info pages and the home hero keep step-4 */
@media (min-width: 48rem) {
  .page-head:not(.page-head--info) h1 { font-size: var(--step-3); }
}
