/*
 * Padelteam De Vliegende Bal – stijlblad.
 * Kleuren komen als CSS-variabelen uit /theme.css (config/padel.php).
 * De waarden hieronder zijn alleen een terugval.
 */
:root {
  --c-primary: #0b2a5b;
  --c-primary-dark: #071c3d;
  --c-accent: #ffd21f;
  --c-accent-dark: #e6b800;
  --c-surface: #ffffff;
  --c-muted: #eef1f6;
  --c-text: #14213d;
  --c-ok: #1f7a3f;
  --c-warn: #a15c00;
  --c-danger: #b3261e;
  --c-line: #d7dde8;
  --c-subtle: #5b6780;
  --radius: 14px;
  --tap: 48px;
  --shadow: 0 1px 2px rgba(7, 28, 61, .08), 0 4px 14px rgba(7, 28, 61, .06);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  color: var(--c-text);
  background: var(--c-muted);
  min-height: 100vh;
  overflow-wrap: break-word;
}

a { color: var(--c-primary); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--c-accent-dark);
  outline-offset: 2px;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--c-subtle); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---------- Kop ---------- */
.app-header {
  background: var(--c-primary);
  color: #fff;
  padding: calc(.7rem + var(--safe-top)) 1rem .75rem;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 4px solid var(--c-accent);
}
.app-header__inner { max-width: 680px; margin: 0 auto; display: flex; align-items: center; gap: .75rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; min-width: 0; }
.brand__logo { height: 40px; width: auto; background: #fff; border-radius: 8px; padding: 2px; }
.brand__mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--c-accent); color: var(--c-primary);
  font-weight: 900; font-size: .95rem; letter-spacing: -.02em; flex: none;
}
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__name { font-weight: 800; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__ctx { font-size: .8rem; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__ctx strong { color: var(--c-accent); font-weight: 700; }

/* ---------- Inhoud ---------- */
.main {
  max-width: 680px;
  margin: 0 auto;
  padding: 1rem 1rem calc(6rem + var(--safe-bottom));
}
.main--guest { padding-top: 2rem; padding-bottom: 3rem; }
.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: .5rem; }

.card {
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}
.card--hero { border-top: 6px solid var(--c-accent); }
.card--attention { border-left: 6px solid var(--c-danger); }
.card--cancelled { opacity: .85; border-left: 6px solid var(--c-danger); }
.card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; margin-bottom: .5rem; flex-wrap: wrap; }
.card__eyebrow { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c-subtle); margin-bottom: .2rem; }
.card__title { font-size: 1.3rem; font-weight: 800; margin: 0; }
.section-title { font-size: .85rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--c-subtle); margin: 1.5rem 0 .5rem; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem .75rem; margin: .5rem 0 0; }
.facts dt { color: var(--c-subtle); font-size: .9rem; }
.facts dd { margin: 0; font-weight: 600; }
.facts .missing { color: var(--c-warn); font-weight: 700; }

.callout {
  border-radius: 10px; padding: .75rem .9rem; margin: .5rem 0;
  background: var(--c-muted); border-left: 5px solid var(--c-primary);
}
.callout--warn { border-color: var(--c-warn); background: #fff6e5; }
.callout--danger { border-color: var(--c-danger); background: #fdecea; }
.callout--ok { border-color: var(--c-ok); background: #e9f6ee; }
.callout > :last-child { margin-bottom: 0; }

/* ---------- Statuslabels: altijd tekst + vorm, kleur is nooit de enige aanwijzing ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .8rem; font-weight: 700; line-height: 1;
  padding: .35rem .55rem; border-radius: 999px;
  border: 2px solid currentColor; background: #fff; white-space: nowrap;
}
.badge::before { content: "•"; font-size: 1rem; line-height: 0; }
.badge--ok { color: var(--c-ok); }
.badge--ok::before { content: "✓"; font-size: .85rem; }
.badge--warn { color: var(--c-warn); }
.badge--warn::before { content: "!"; font-size: .85rem; }
.badge--danger { color: var(--c-danger); }
.badge--danger::before { content: "✕"; font-size: .8rem; }
.badge--muted { color: var(--c-subtle); }
.badge--info { color: var(--c-primary); }
.badge--accent { color: var(--c-primary); background: var(--c-accent); border-color: var(--c-accent); }
.badge--accent::before { content: "★"; font-size: .8rem; }

.todo-list { list-style: none; margin: .5rem 0 0; padding: 0; }
.todo-list li { display: flex; gap: .5rem; align-items: flex-start; padding: .35rem 0; font-weight: 600; }
.todo-list li::before { content: "!"; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; font-size: .8rem; font-weight: 900; color: #fff; background: var(--c-warn); margin-top: .05rem; }
.todo-list li.todo--danger::before { content: "✕"; background: var(--c-danger); }
.todo-list--done li::before { content: "✓"; background: var(--c-ok); }

/* ---------- Knoppen ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: var(--tap); padding: .6rem 1.1rem;
  border-radius: 12px; border: 2px solid var(--c-primary);
  background: #fff; color: var(--c-primary);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--c-muted); }
.btn--primary { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-primary-dark); }
.btn--primary:hover { background: var(--c-accent-dark); border-color: var(--c-accent-dark); }
.btn--dark { background: var(--c-primary); color: #fff; }
.btn--dark:hover { background: var(--c-primary-dark); }
.btn--danger { border-color: var(--c-danger); color: var(--c-danger); }
.btn--danger:hover { background: #fdecea; }
.btn--ghost { border-color: transparent; background: transparent; text-decoration: underline; padding-left: .25rem; padding-right: .25rem; }
.btn--small { min-height: 40px; padding: .4rem .8rem; font-size: .9rem; }
.btn--block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn-row > form { display: contents; }

/* Beschikbaarheid: drie grote keuzeknoppen */
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.choice form { margin: 0; }
.choice button {
  width: 100%; min-height: 64px; border-radius: 12px; border: 2px solid var(--c-line);
  background: #fff; color: var(--c-text); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; padding: .4rem;
}
.choice button .icon { font-size: 1.25rem; line-height: 1; }
.choice button[aria-pressed="true"] { border-width: 3px; }
.choice button[aria-pressed="true"].tone-ok { border-color: var(--c-ok); background: #e9f6ee; color: var(--c-ok); }
.choice button[aria-pressed="true"].tone-warn { border-color: var(--c-warn); background: #fff6e5; color: var(--c-warn); }
.choice button[aria-pressed="true"].tone-danger { border-color: var(--c-danger); background: #fdecea; color: var(--c-danger); }
.choice button[aria-pressed="true"]::after { content: "Jouw keuze"; font-size: .7rem; font-weight: 600; }

/* ---------- Personen ---------- */
.avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-primary); color: var(--c-accent); font-weight: 800; font-size: .95rem;
  object-fit: cover; overflow: hidden;
}
.avatar--lg { width: 88px; height: 88px; font-size: 1.6rem; }
.avatar--sm { width: 32px; height: 32px; font-size: .75rem; }

.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--c-muted); }
.people li:last-child { border-bottom: 0; }
.people__main { flex: 1; min-width: 0; }
.people__name { font-weight: 700; display: block; }
.people__meta { font-size: .88rem; color: var(--c-subtle); }
.people__aside { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }
.phone { white-space: nowrap; font-weight: 600; }

.group-title { display: flex; justify-content: space-between; align-items: center; margin: 1rem 0 .25rem; font-weight: 800; }

/* ---------- Lijsten van wedstrijden ---------- */
.fixture-list { list-style: none; margin: 0; padding: 0; }
.fixture-list > li + li { margin-top: .75rem; }
.fixture-item { display: flex; gap: .85rem; align-items: stretch; text-decoration: none; color: inherit; }
.fixture-item__date {
  flex: none; width: 58px; border-radius: 10px; background: var(--c-primary); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: .35rem 0; text-align: center;
}
.fixture-item__day { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-accent); font-weight: 700; }
.fixture-item__num { font-size: 1.45rem; font-weight: 900; line-height: 1; }
.fixture-item__month { font-size: .72rem; text-transform: uppercase; }
.fixture-item__body { flex: 1; min-width: 0; }
.fixture-item__title { font-weight: 800; display: block; }
.fixture-item__meta { font-size: .88rem; color: var(--c-subtle); }
.fixture-item__badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }

/* ---------- Formulieren ---------- */
.field { display: block; margin-bottom: 1rem; }
.field > span, .field legend { display: block; font-weight: 700; margin-bottom: .3rem; }
.field small { display: block; margin-top: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url],
input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; min-height: var(--tap); padding: .6rem .75rem;
  border: 2px solid var(--c-line); border-radius: 10px; background: #fff;
  font: inherit; color: inherit;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--c-primary); }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.error-text { color: var(--c-danger); font-weight: 700; font-size: .9rem; margin-top: .25rem; display: block; }
.error-text::before { content: "✕ "; }

.option-list { display: grid; gap: .5rem; }
.option {
  display: flex; align-items: center; gap: .75rem; min-height: 56px; padding: .55rem .8rem;
  border: 2px solid var(--c-line); border-radius: 12px; background: #fff; cursor: pointer;
}
.option input { width: 22px; height: 22px; flex: none; accent-color: var(--c-primary); }
.option:has(input:checked) { border-color: var(--c-primary); background: #f3f6fb; }
.option:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.option__text { flex: 1; min-width: 0; }
.option__text strong { display: block; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }

details.disclosure { border: 2px solid var(--c-line); border-radius: 12px; padding: 0 .9rem; background: #fff; }
details.disclosure > summary { min-height: var(--tap); display: flex; align-items: center; font-weight: 700; cursor: pointer; list-style: none; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: "▾"; margin-left: auto; }
details.disclosure[open] > summary::after { content: "▴"; }
details.disclosure[open] { padding-bottom: .9rem; }

/* ---------- Meldingen ---------- */
.flash { border-radius: 12px; padding: .8rem 1rem; font-weight: 600; margin-bottom: 1rem; display: flex; gap: .6rem; }
.flash::before { font-weight: 900; }
.flash--ok { background: #e9f6ee; color: #11522a; border: 2px solid var(--c-ok); }
.flash--ok::before { content: "✓"; }
.flash--error { background: #fdecea; color: #7d1a14; border: 2px solid var(--c-danger); }
.flash--error::before { content: "✕"; }

.offline-banner {
  position: fixed; left: 0; right: 0; bottom: calc(64px + var(--safe-bottom)); z-index: 30;
  background: var(--c-text); color: #fff; padding: .7rem 1rem; text-align: center; font-weight: 600; font-size: .92rem;
}
.offline-banner[hidden] { display: none; }

/* ---------- Navigatie onderaan ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--c-primary); padding-bottom: var(--safe-bottom);
  border-top: 3px solid var(--c-accent);
}
.bottom-nav ul { list-style: none; margin: 0 auto; padding: 0; display: flex; max-width: 680px; }
.bottom-nav li { flex: 1; }
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
  min-height: 62px; color: #dfe6f3; text-decoration: none; font-size: .75rem; font-weight: 600;
}
.bottom-nav a .nav-icon { font-size: 1.25rem; line-height: 1; }
.bottom-nav .nav-label { white-space: nowrap; }
.bottom-nav a[aria-current="page"] { color: var(--c-accent); font-weight: 800; }
.bottom-nav a[aria-current="page"] .nav-label { text-decoration: underline; text-underline-offset: 3px; }

/* Zeer smalle telefoons (320–360 px): alles past zonder horizontaal scrollen. */
@media (max-width: 360px) {
  body { font-size: 16px; }
  .main { padding-left: .75rem; padding-right: .75rem; }
  .card { padding: .85rem; }
  .bottom-nav a { font-size: .68rem; }
  .choice button { font-size: .8rem; }
  .brand__name { font-size: .92rem; }
}

/* ---------- Beheer ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.tile {
  display: flex; flex-direction: column; gap: .3rem; padding: 1rem; min-height: 96px;
  border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); text-decoration: none; color: var(--c-text);
}
.tile strong { font-size: 1rem; }
.tile span { font-size: .85rem; color: var(--c-subtle); }
.tile .tile__count { font-size: 1.6rem; font-weight: 900; color: var(--c-primary); }
.log-list { list-style: none; padding: 0; margin: 0; }
.log-list li { padding: .6rem 0; border-bottom: 1px solid var(--c-muted); font-size: .92rem; }

.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 1rem; }

.install-hint { display: flex; gap: .75rem; align-items: center; }
.install-hint[hidden] { display: none; }
.install-hint p { margin: 0; flex: 1; }

.profile-photo { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.profile-photo > .stack-sm { flex: 1; min-width: 0; }
.profile-photo input[type=file] { width: 100%; font-size: .9rem; }

.steps { padding-left: 1.25rem; }
.steps li { margin-bottom: .5rem; }

.auth-card { max-width: 420px; margin: 0 auto; }
.auth-brand { text-align: center; margin-bottom: 1.25rem; }
.auth-brand .brand__mark { width: 64px; height: 64px; font-size: 1.4rem; border-radius: 16px; }
.auth-brand img { max-height: 90px; }
.auth-brand h1 { margin-top: .75rem; color: var(--c-primary); }

@media (min-width: 560px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .main { padding-top: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
