/* Base for every page: tokens, type, header, buttons, form controls, toasts.
   Page-specific styles go in the stylesheet of that page (css/<page>.css). No external fonts or CDNs. */
:root {
  --ink: #15191e;          /* graphite: text and dark surfaces */
  --ink-2: #2a313a;
  --steel: #5b6673;
  --line: #dfe3e8;
  --bg: #f4f5f7;
  --card: #ffffff;
  --accent: #ffc21a;       /* signal yellow, like machine guarding */
  --accent-ink: #1a1400;
  --accent-dark: #e0a800;
  --blue: #1f5fd6;
  --ok: #1f8a4c;
  --warn: #b26a00;
  --err: #c0362c;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --header-h: 64px;        /* the header is one row of this height on every screen; pages hang things under it */
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; font-size: 15px; }
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--steel); }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

/* Header. Filled in by js/app.js; the room is kept before that, so the page does not jump when it arrives.
   overflow-x: clip is the last resort for a font that is wider than the ones this was measured in: a button is cut
   off before the whole page gets a sideways scrollbar. (clip, not hidden: the account menu hangs below the bar.) */
#site-header { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 50; min-height: var(--header-h); overflow-x: clip; }
.header-row { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.logo { color: #fff; text-decoration: none; font-size: 21px; letter-spacing: .2px; display: flex; align-items: center; gap: 10px; flex: none; white-space: nowrap; }
.logo b { color: var(--accent); font-weight: 700; }
.logo-mark { width: 22px; height: 22px; border: 3px solid var(--accent); border-radius: 50%; position: relative; flex: none; }
.logo-mark::after { content: ""; position: absolute; inset: 5px; background: var(--accent); border-radius: 50%; }
.main-nav { display: flex; gap: 20px; flex: none; }
.main-nav a { color: #cfd5dc; text-decoration: none; font-size: 14.5px; white-space: nowrap; }
.main-nav a:hover, .main-nav a.active { color: #fff; }
/* Pushed to the right by its own margin: the navigation is not there on a small screen. Only the name gives way. */
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; }
.header-actions .btn { flex: none; white-space: nowrap; }
.header-actions .who { color: #cfd5dc; font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The account menu of a small screen: what the navigation and the name say on a wide one. */
.header-menu { display: none; position: relative; flex: none; }
.header-menu > summary { list-style: none; padding: 7px 9px; }
.header-menu > summary::-webkit-details-marker { display: none; }
.header-menu > summary svg { display: block; width: 18px; height: 18px; }
.header-menu-list { position: absolute; right: 0; top: calc(100% + 16px); z-index: 60; display: grid; gap: 2px; width: max-content; min-width: 200px;
  max-width: min(300px, calc(100vw - 24px)); padding: 6px; background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.header-menu-who { padding: 6px 10px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--steel);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-menu-list a, .header-menu-list button { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: none;
  font: inherit; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; }
.header-menu-list a:hover, .header-menu-list button:hover, .header-menu-list a.active { background: var(--bg); }
@media (max-width: 1179px) { .header-actions .who { display: none; } }
/* From 980 to 1179 px the navigation stands with all its items (for the owner seven, "Tekenen" and "Beheer"
   included) beside "Uitloggen" and "Bereken je prijs": a little less room between them keeps it one row. */
@media (min-width: 980px) and (max-width: 1179px) {
  .header-row { gap: 16px; }
  .main-nav { gap: 14px; }
}
@media (max-width: 979px) {
  .main-nav, .header-actions > #logout-btn { display: none; }
  .header-menu { display: block; }
}
/* A phone, from 360 px: logged out the logo, "Inloggen" and "Bereken je prijs" need about 320 px of the 336 there
   are, logged in (the menu in place of "Inloggen") less. */
@media (max-width: 480px) {
  #site-header .wrap { padding: 0 12px; }
  .header-row { gap: 10px; }
  .logo { font-size: 17px; gap: 7px; }
  .logo-mark { width: 18px; height: 18px; }
  .logo-mark::after { inset: 4px; }
  .header-actions { gap: 6px; }
  .header-actions .btn-sm { padding: 7px 10px; font-size: 13px; }
  .header-actions a.btn-ghost { padding: 7px 6px; border-color: transparent; }
}
/* Narrower than any current phone: the mark alone still leads home. */
@media (max-width: 339px) { .logo-text { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px;
  padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn-sm { padding: 7px 12px; font-size: 13.5px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; opacity: .9; }
.btn-light { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-light:hover { border-color: var(--steel); }
.btn-danger { background: #fff; color: var(--err); border-color: #f0c2bd; }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* Forms */
label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); display: block; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], select, textarea {
  width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent-dark); }
.field { margin-bottom: 14px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #eef1f4; color: var(--ink-2); }
.badge-ok { background: #e3f4ea; color: var(--ok); }
.badge-warn { background: #fff2d6; color: var(--warn); }
.badge-err { background: #fbe5e3; color: var(--err); }
.notice { padding: 10px 12px; border-radius: 8px; background: #fff7e0; border: 1px solid #ffe3a1; font-size: 13.5px; }
.notice-err { background: #fdecea; border-color: #f5c2bd; color: #7a1f18; }

table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.grid th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--steel); font-weight: 600; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Toasts. A message only tells something: a click meant for the button underneath it must reach that button. */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 1000; display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 14px; transition: opacity .5s; }
.toast-ok { background: var(--ok); }
.toast-error { background: var(--err); }
.toast.out { opacity: 0; }

/* Footer. Filled in by js/app.js: who we are on the left, where to go on the right. It stays a few lines high;
   the address and the numbers of the company arrive with the catalogue, so they take their room only then. */
.site-footer { background: var(--ink); color: #aab3bd; padding: 36px 0; margin-top: 64px; font-size: 14px; }
.site-footer a { color: #dfe4ea; }
.site-footer-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px 40px; }
/* The company gives way to the links, and a name or an address without a space in it breaks before it widens a phone. */
.site-footer-company { flex: 0 1 34rem; display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.site-footer-company p, .site-footer-company address { margin: 0; font-style: normal; }
.site-footer-facts { display: flex; flex-wrap: wrap; gap: 0 18px; font-size: 13px; }
.site-footer-links { flex: none; display: grid; gap: 8px; justify-items: end; }
.site-footer-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
/* The landing page has a footer of its own (css/home.css); its last line carries the same links to the information pages. */
.site-footer-legal { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 28px; }
.site-footer-legal p { margin: 0; }
/* Below the width where the header drops its page links (they live here then): one column, and the links start
   where the text starts. */
@media (max-width: 979px) {
  .site-footer-row { flex-direction: column; }
  .site-footer-company { flex-basis: auto; }
  .site-footer-links { justify-items: start; max-width: 100%; }
}
