/* Webapp Master – gedeelde vormgeving voor alle webapps. Kleuren per app via --primary en --accent. */
:root {
  --primary: #17606E;
  --accent: #E8876A;
  --ink: #2f2f2b;
  --muted: #6b6b66;
  --line: #e7e5e0;
  --bg: #f6f5f2;
  --card: #ffffff;
  --ok: #2e7d4f;
  --err: #b3261e;
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, white); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Opbouw ---------- */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line); padding: calc(var(--safe-top) + 10px) 16px 10px;
}
.topbar-inner { max-width: 760px; margin: 0 auto; display: flex; align-items: center; gap: 12px; min-height: 44px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { height: 40px; width: auto; max-width: 180px; object-fit: contain; }
.brand .brand-name { font-weight: 750; font-size: 17px; line-height: 1.15; }
.brand .brand-sub { display: block; font-weight: 500; font-size: 13px; color: var(--muted); }
.back {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: -10px;
  border: 0; background: none; border-radius: 50%; cursor: pointer; color: var(--primary); flex: none;
}
.back:active { background: var(--bg); }
.topbar h1 { margin: 0; font-size: 18px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.topbar .call-mini { flex: none; }

main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 16px 16px calc(var(--safe-bottom) + 24px); }
main:focus { outline: none; }

/* ---------- Home ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 22px 20px 20px; color: #fff;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #000));
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px; border-radius: 40px;
  background: var(--accent); opacity: .9; transform: rotate(45deg);
}
.hero > * { position: relative; z-index: 1; max-width: 78%; }
.hero h2 { margin: 0 0 6px; font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
.hero p { margin: 0; opacity: .92; font-size: 15px; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 6px; }
.quick a {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; text-decoration: none;
  color: var(--ink); background: var(--card); border-radius: 16px; font-size: 13px; font-weight: 650; border: 1px solid var(--line);
}
.quick a:active { transform: scale(.97); }
.quick .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--primary); }
.quick .wa .ic { background: #25a35a; }
.quick .ml .ic { background: var(--accent); }
.quick .rt .ic { background: var(--ink); }

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 22px 4px 10px; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 620px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile {
  display: flex; flex-direction: column; gap: 10px; padding: 16px 14px; min-height: 128px; text-decoration: none; color: var(--ink);
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); position: relative;
  transition: transform .12s ease, box-shadow .12s ease;
}
.tile:hover { box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.tile:active { transform: scale(.98); }
.tile .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--c, var(--primary)); }
.tile strong { font-size: 16px; line-height: 1.2; font-weight: 750; }
.tile span.sub { font-size: 13px; color: var(--muted); line-height: 1.3; margin-top: -6px; }
.tile .ext { position: absolute; right: 12px; top: 14px; color: var(--muted); }

.review {
  display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 14px 16px; background: var(--card);
  border-radius: var(--radius); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.review .score { font-size: 28px; font-weight: 800; color: var(--primary); }
.review .stars { color: #f2b300; letter-spacing: 2px; font-size: 15px; }
.review small { color: var(--muted); display: block; }

.install {
  margin-top: 14px; padding: 16px; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 14%, white);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, white); position: relative;
}
.install h3 { margin: 0 0 4px; font-size: 16px; }
.install p { margin: 0 0 10px; font-size: 14px; }
.install ol { margin: 6px 0 0; padding-left: 20px; font-size: 14px; }
.install li { margin: 4px 0; }
.install .close { position: absolute; right: 6px; top: 6px; width: 40px; height: 40px; border: 0; background: none; cursor: pointer; color: var(--muted); border-radius: 50%; }
.install .share { display: inline-block; vertical-align: -4px; }

/* ---------- Kaarten / inhoud ---------- */
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); padding: 18px 16px; margin-bottom: 12px; }
.card h2 { margin: 0 0 6px; font-size: 20px; line-height: 1.25; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.lead { color: var(--muted); margin: 0 0 14px; }
.muted { color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--line); }
.list a, .list .row {
  display: flex; align-items: center; gap: 12px; padding: 13px 2px; text-decoration: none; color: var(--ink); min-height: 52px;
}
.list .grow { flex: 1; min-width: 0; }
.list small { display: block; color: var(--muted); font-size: 13px; }
.list .num { font-weight: 700; color: var(--primary); white-space: nowrap; }
.list .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 12%, white); color: var(--primary); flex: none; }
.sos { background: var(--err) !important; color: #fff !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 20px;
  border-radius: 14px; border: 0; background: var(--primary); color: #fff; font-weight: 700; font-size: 16px;
  text-decoration: none; cursor: pointer; width: 100%;
}
.btn:active { transform: scale(.99); filter: brightness(.95); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.secondary { background: color-mix(in srgb, var(--primary) 10%, white); color: var(--primary); }
.btn.wa { background: #25a35a; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.btn-row .btn { padding: 12px 10px; font-size: 15px; white-space: nowrap; }

.team { display: grid; gap: 12px; }
@media (min-width: 620px) { .team { grid-template-columns: 1fr 1fr; } }
.member { text-align: center; }
.member img, .member .avatar {
  width: 112px; height: 112px; border-radius: 50%; object-fit: cover; margin: 0 auto 10px; background: color-mix(in srgb, var(--primary) 12%, white);
  display: grid; place-items: center; font-size: 38px; font-weight: 800; color: var(--primary);
}
.member .avatar { overflow: hidden; align-items: end; color: color-mix(in srgb, var(--primary) 45%, white); }
.member .avatar svg { width: 84%; height: 84%; display: block; }
.member p { font-size: 15px; }

/* ---------- Formulieren ---------- */
form .field { margin-bottom: 14px; }
form label, form legend { display: block; font-weight: 650; font-size: 15px; margin-bottom: 6px; padding: 0; }
form .req { color: var(--err); }
form .hint { font-size: 13px; color: var(--muted); margin: -2px 0 6px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 1.5px solid #d6d3cc; border-radius: 12px; background: #fff;
  font-size: 16px; /* voorkomt inzoomen op iPhone */ appearance: none; -webkit-appearance: none;
}
input[type=date] { display: block; }
textarea { min-height: 110px; resize: vertical; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b6b66' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.invalid input, .invalid select, .invalid textarea { border-color: var(--err); }
.err-msg { color: var(--err); font-size: 13px; margin-top: 4px; }
fieldset { border: 0; margin: 0 0 14px; padding: 0; min-width: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 10px 14px; border-radius: 999px;
  border: 1.5px solid #d6d3cc; background: #fff; font-size: 15px; font-weight: 600;
}
.choice input:checked + span { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, white); color: var(--primary); }
.choice input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 55%, white); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500 !important; font-size: 14px !important; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--primary); }
.hp { position: absolute !important; left: -9999px !important; height: 0; overflow: hidden; }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 22px 14px; text-align: center;
  border: 2px dashed #cfcac0; border-radius: 16px; background: #fbfaf8; cursor: pointer; color: var(--muted); font-size: 14px;
}
.drop strong { color: var(--primary); font-size: 16px; }
.drop.over { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, white); }
.file-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.file-btns .btn { font-size: 15px; padding: 10px 8px; white-space: nowrap; }
.files { list-style: none; padding: 0; margin: 10px 0 0; }
.files li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: #fff; border: 1px solid var(--line); margin-bottom: 6px; font-size: 14px; }
.files img, .files .doc { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: var(--bg); display: grid; place-items: center; color: var(--muted); }
.files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files button { border: 0; background: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; color: var(--muted); }

.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 10px; display: none; }
.progress.on { display: block; }
.progress span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 15px; margin-bottom: 12px; }
.alert.err { background: #fdecea; color: var(--err); }
.alert.info { background: color-mix(in srgb, var(--primary) 9%, white); color: var(--ink); }

.done { text-align: center; padding: 30px 16px; }
.done .tick { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--ok) 14%, white); color: var(--ok); }
.done h2 { margin: 0 0 6px; }

/* Voettekst */
.foot { margin-top: 26px; text-align: center; font-size: 13px; color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-bottom: 8px; }
.foot a { color: var(--muted); }
.social { display: flex; justify-content: center; gap: 10px; margin: 10px 0; }
.social a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); color: var(--ink); }

.offline { position: fixed; left: 12px; right: 12px; bottom: calc(var(--safe-bottom) + 12px); z-index: 50; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 14px; text-align: center; display: none; }
.offline.on { display: block; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@supports not (color: color-mix(in srgb, red, blue)) {
  .list .ic { background: #eef3f4; }
  .install { background: #fdf1ec; border-color: #f6d3c5; }
  .choice input:checked + span, .btn.secondary, .alert.info { background: #eef3f4; }
}

/* Aanvullingen: adresvelden, voorwaardelijke velden, tekstpagina's, QR */
.two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.form-h { font-size: 17px; margin: 22px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.cond[hidden] { display: none; }
.rich p { margin: 0 0 10px; }
.rich p:last-child { margin-bottom: 0; }
.steps { margin: 0 0 12px; padding: 0; list-style: none; counter-reset: s; }
.steps li { position: relative; padding: 8px 0 8px 40px; counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 6px; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
.qr-wrap { display: flex; gap: 14px; align-items: center; }
.qr-wrap p { margin: 0 0 6px; }
.qr { border-radius: 10px; background: #fff; flex: none; }
.topbar h1:focus, main:focus, .done:focus { outline: none; }

/* Desktop: alleen QR-code */
.qr-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 10%, white), var(--bg)); }
.qr-card { background: #fff; border-radius: 24px; border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0,0,0,.08); padding: 36px 40px; max-width: 440px; width: 100%; text-align: center; }
.qr-logo { max-height: 64px; max-width: 260px; margin: 0 auto 22px; object-fit: contain; }
.qr-name { margin: 0 0 18px; font-size: 22px; }
.qr-card h2 { margin: 0 0 6px; font-size: 22px; }
.qr-card .muted { margin: 0; }
.qr-big { margin: 22px auto 10px; border-radius: 12px; }
.qr-url { font-size: 13px; color: var(--muted); word-break: break-all; margin: 0 0 14px; }
.qr-contact a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* Foto's in de headers */
.hero.has-photo { background-size: cover; background-position: center; min-height: 230px; display: flex; flex-direction: column; justify-content: flex-end; }
.hero.has-photo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 15%, color-mix(in srgb, var(--primary) 55%, rgba(0,0,0,.35)) 55%, color-mix(in srgb, var(--primary) 92%, #000) 100%); z-index: 0; }
.hero.has-photo::after { width: 90px; height: 90px; right: -30px; top: -30px; border-radius: 22px; }
.hero.has-photo > * { max-width: 100%; text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.page-hero { position: relative; height: 150px; border-radius: var(--radius); background-size: cover; background-position: center; margin-bottom: 12px; overflow: hidden; display: flex; align-items: flex-end; }
@media (min-width: 620px) { .page-hero { height: 200px; } .hero.has-photo { min-height: 280px; } }
.page-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.6) 100%); }
.page-hero-text { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: #fff; }
.page-hero-text .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary); flex: none; }
.page-hero-text strong { display: block; font-size: 20px; line-height: 1.2; }
.page-hero-text span:not(.ic) { font-size: 14px; opacity: .9; }
details.fold summary { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; min-height: 32px; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary h3 { margin: 0; }
details.fold .count { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
details.fold .count::after { content: ""; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -4px 2px 0 4px; transition: transform .15s; }
details.fold[open] .count::after { transform: rotate(-135deg); margin-top: 4px; }
details.fold[open] summary { margin-bottom: 6px; }
