/* Onibat public site and customer area. No JavaScript, no third-party requests, system fonts.
   Colours come only from theme.css (loaded first): light and dark follow the device, the
   footer form can force one. See docs/REDESIGN.md. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1.0625rem/1.6 var(--font); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-weight: 800; line-height: 1.08; letter-spacing: -0.025em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; max-width: 68ch; }
small { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: 0.5rem 1rem; z-index: 10; border-radius: var(--radius); }

/* ---- header ---- */
.masthead { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.75rem; padding: 0.75rem clamp(1rem, 4vw, 3rem); background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; min-height: 2.75rem; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-mark { width: 2.5rem; height: 2.5rem; flex: 0 0 auto; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); }
.brand-text { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.brand-name { font-size: 1.45rem; font-weight: 800; letter-spacing: 0.02em; }
.brand-accent { color: var(--brand); }
.brand-tagline { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 0.3rem; }
.masthead nav { margin-left: auto; }
.masthead ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.masthead nav a { color: var(--text); text-decoration: none; padding: 0.35rem 0; border-bottom: 3px solid transparent; }
.masthead nav a:hover, .masthead nav a[aria-current] { border-bottom-color: var(--brand); }
.phone { font-weight: 700; white-space: nowrap; color: var(--text); text-decoration: none; }

/* ---- home hero: the head tile and the service tiles ---- */
.wall { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(10rem, auto); gap: 0.875rem; width: min(84rem, calc(100% - 2 * clamp(1rem, 4vw, 3rem))); margin: clamp(1rem, 3vw, 2rem) auto; }
.tile { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); padding: 1.25rem; display: flex; flex-direction: column; justify-content: flex-end; text-decoration: none; color: var(--text); }
.tile-head { grid-column: span 2; grid-row: span 2; justify-content: center; padding: clamp(1.5rem, 4vw, 3rem); background: var(--navy); border-color: var(--navy); color: var(--navy-text); }
.tile-head h1 { color: var(--navy-text); }
.tile-head p { font-size: 1.15rem; color: var(--navy-text); opacity: 0.85; margin: 0; }
.tile-service { background: var(--tile); border-color: var(--tile); }
.tile-service img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-service span { position: relative; font-weight: 700; font-size: 1.15rem; background: var(--surface); color: var(--text); padding: 0.45rem 0.75rem; border-radius: 10px; align-self: flex-start; box-shadow: var(--shadow); }
.tile-service:hover span, .tile-service:focus-visible span { background: var(--accent); color: var(--accent-text); }
.tile-wide { grid-column: span 2; }
.tile-cta { grid-column: span 2; background: var(--accent); border-color: var(--accent); color: var(--accent-text); gap: 0.35rem; }
.tile-cta strong { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.tile-cta:hover { background: var(--accent-hover); color: var(--accent-text); }

/* ---- content bands ---- */
.band { --measure: 76rem; padding-block: clamp(2rem, 6vw, 4.5rem); padding-inline: max(clamp(1rem, 4vw, 3rem), calc((100% - var(--measure)) / 2)); }
.band.narrow { --measure: 46rem; }
.band + .band { border-top: 1px solid var(--line); }
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.columns > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.25rem; }
.columns p { color: var(--muted); margin: 0; }
.lead { font-size: 1.2rem; color: var(--muted); }
.trail { font-size: 0.95rem; margin-bottom: 0.5rem; }
.list { list-style: none; padding: 0; margin: 0 0 2rem; }
.list li { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.list a { font-weight: 700; font-size: 1.3rem; text-decoration: none; }
.list p { margin: 0.25rem 0 0; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.card { overflow: hidden; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; padding-bottom: 1rem; display: flex; flex-direction: column; gap: 0.15rem; }
.card strong, .card span { padding: 0 1rem; }
.card strong { margin-top: 0.75rem; }
.card span { color: var(--muted); font-size: 0.95rem; }
.card:hover { border-color: var(--accent); color: var(--text); }
.card:hover strong { color: var(--accent); }
.prose img { margin: 1.5rem 0; border-radius: var(--radius); }
.prose h2 { margin-top: 1.5em; }

/* ---- buttons and forms ---- */
.button { display: inline-block; font: 700 1.05rem/1 var(--font); background: var(--accent); color: var(--accent-text); border: 0; border-radius: var(--radius); padding: 0.95rem 1.4rem; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--accent-hover); color: var(--accent-text); }
.button.quiet { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.button.quiet:hover { background: var(--sunken); color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 1rem; }

form { margin-top: 1.5rem; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 1.25rem; }
.field { margin-bottom: 1.1rem; }
label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea { width: 100%; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 0.85rem; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
[aria-invalid="true"] { border-color: var(--danger); }
.check { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; align-items: start; }
.check label { font-weight: 400; margin: 0; }
.check input { width: 1.2rem; height: 1.2rem; margin-top: 0.25rem; accent-color: var(--accent); }
.check .error { grid-column: 2; }
.error { color: var(--danger); font-size: 0.95rem; margin: 0.3rem 0 0; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice, .result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; margin-top: 1.5rem; box-shadow: inset 4px 0 0 var(--brand); }
.range { font-weight: 800; font-size: clamp(1.7rem, 4.5vw, 2.6rem); line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 0.4em; }

.scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; min-width: 38rem; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tfoot td { border-bottom: 0; padding-top: 0.4rem; padding-bottom: 0.4rem; }
tfoot .total td { font-weight: 800; border-top: 2px solid var(--text); }

/* ---- footer, theme choice ---- */
.footer { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.5rem; padding: 2.5rem clamp(1rem, 4vw, 3rem); background: var(--navy); color: var(--navy-text); }
.footer a { color: var(--navy-text); }
.footer a:hover { color: var(--brand); }
.theme-choice { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.theme-choice span { margin-right: 0.25rem; opacity: 0.85; }
.theme-choice button { font: inherit; font-size: 0.95rem; min-height: 2.75rem; padding: 0 0.9rem; border-radius: 999px; border: 1px solid rgb(255 255 255 / 25%); background: transparent; color: var(--navy-text); cursor: pointer; }
.theme-choice button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #13233a; font-weight: 700; }

.phone-short { display: none; }
@media (max-width: 52rem) {
  .wall { grid-template-columns: repeat(2, 1fr); }
  /* Two tidy rows: brand, call and account on top; the navigation on one scrollable line. */
  .masthead { gap: 0 0.75rem; padding-top: 0.5rem; padding-bottom: 0; }
  .masthead .phone { margin-left: auto; }
  .masthead nav { margin-left: 0; order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .masthead nav::-webkit-scrollbar { display: none; }
  .masthead ul { flex-wrap: nowrap; gap: 0 1.1rem; white-space: nowrap; font-size: 0.97rem; }
}
@media (max-width: 40rem) {
  .phone-number { display: none; }
  .phone-short { display: inline; }
  .brand-tagline { display: none; }
  /* Phones: keep brand, call and account on a single row whatever the system font metrics
     (Inter, Roboto, DejaVu Sans...). The brand is the one item allowed to give way: a zero
     flex basis keeps it out of the line-break decision and it grows into the leftover width,
     truncating with an ellipsis rather than wrapping. */
  .brand { flex: 1 1 0; min-width: 0; }
  .brand-name { font-size: 1.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 30rem) {
  .wall { grid-template-columns: 1fr; grid-auto-rows: minmax(7rem, auto); }
  .tile-head, .tile-cta, .tile-wide { grid-column: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .tile-service span, .button, .tile-cta, .card { transition: background-color 120ms ease-out, color 120ms ease-out, border-color 120ms ease-out; }
}

/* ---- customer area, booking, installable-app polish ---- */
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.footer { padding-bottom: calc(2.5rem + env(safe-area-inset-bottom)); }
.account-link { font-weight: 700; color: var(--navy-text); background: var(--navy); padding: 0.6rem 1rem; border-radius: var(--radius); text-decoration: none; }
.account-link:hover, .account-link[aria-current] { background: var(--accent); color: var(--accent-text); }
.masthead nav a { display: inline-block; min-height: 2.75rem; line-height: 2.05rem; } /* 44px touch target */
.phone { display: inline-flex; align-items: center; min-height: 2.75rem; }
.or { text-align: center; color: var(--muted); margin: 1.5rem 0 0; }
input.code { font-weight: 700; font-size: 1.6rem; line-height: 1.2; letter-spacing: 0.35em; max-width: 14rem; text-align: center; font-variant-numeric: tabular-nums; }
.rows { list-style: none; padding: 0; margin: 0 0 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.rows li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1.25rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows li > div { flex: 1 1 16rem; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.rows span { color: var(--muted); font-size: 0.97rem; }
.rows em { font-style: normal; font-weight: 700; font-size: 0.9rem; padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--steel-soft); align-self: flex-start; }
.rows form { margin: 0; }
.rows .pre { white-space: pre-line; }
button.link { background: none; border: 0; padding: 0.6rem 0; font: inherit; color: var(--danger); text-decoration: underline; cursor: pointer; }
fieldset.day { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 1rem 0 0.4rem; }
fieldset.day legend { font-weight: 700; font-size: 1.1rem; padding: 0 0.5rem 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.chip { margin: 0; font-weight: 400; position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span { display: inline-block; min-width: 5.25rem; text-align: center; padding: 0.75rem 0.9rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-variant-numeric: tabular-nums; }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 700; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.account { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-start; }
.account form { margin: 0; }
.account summary { cursor: pointer; padding: 0.95rem 0; color: var(--muted); }
.button.danger { background: var(--danger); color: #ffffff; }
.button.danger:hover { background: var(--text); color: var(--bg); }
@media (max-width: 30rem) {
  .button, .actions .button { width: 100%; text-align: center; }
  .account-link { padding: 0.6rem 0.75rem; }
}
@media (display-mode: standalone) {
  /* Installed app: the marketing navigation gives way to the customer area. */
  .masthead nav { display: none; }
  .account-link { margin-left: auto; }
}
@media (max-width: 22.5rem) {
  /* 320px phones: tighter gaps and a smaller mark and name. */
  .masthead { gap: 0 0.5rem; }
  .brand-mark { width: 2.1rem; height: 2.1rem; }
  .brand-name { font-size: 1.2rem; }
  .masthead .phone, .account-link { font-size: 0.95rem; }
  .account-link { padding: 0.6rem 0.5rem; }
}

/* Photos and documents of a site timeline (lot R4b). */
.files { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.files li { display: flex; flex-direction: column; gap: 4px; }
.files img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }

/* Second factor enrolment (lot R6a): the QR code keeps a white quiet zone in both themes. */
.qr-box { margin: 0.75rem 0; }
.qr-box svg.qr { width: 12rem; height: auto; max-width: 100%; background: #ffffff; border-radius: var(--radius); }
.steps { padding-left: 1.25rem; }
.steps li { margin-bottom: 0.75rem; }
code.secret { word-break: break-all; }
.recovery-codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.5rem; }
.recovery-codes code { font-size: 1.05rem; }

/* Photo pipeline (lot R5a): <picture> wraps the <img>; keep existing img layouts unchanged. */
picture { display: contents; }

/* Site content (lot R8): last delivered site, guarantee, towns, language links. */
.card-wide { max-width: 48rem; }
.card-wide img { width: 100%; height: auto; }
.guarantee p { max-width: 48rem; }
.towns { list-style: none; padding: 0; margin: 0 0 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.footer .insurance { font-size: 0.9rem; }
.languages { display: flex; gap: 0.75rem; }
.languages a[aria-current] { font-weight: 700; }

/* Before/after pairs of a realisation (lot R5b): side by side on wide screens, stacked on phones. */
.before-after { margin: 1.5rem 0; }
.before-after-photos { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
@media (min-width: 48rem) { .before-after-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.before-after-photos img { width: 100%; height: auto; border-radius: var(--radius); }
.before-after-label { display: inline-block; font-weight: 700; font-size: 0.9rem; margin-bottom: 0.35rem; color: var(--muted); }
.before-after figcaption { color: var(--muted); margin-top: 0.5rem; }
