/* Alarmapp Control. Same house style as the website (docs/huisstijl.md): white, one blue, sharp corners, thin lines,
   calm motion. The status colours mean exactly what they mean in the app. */

:root {
  --bg: #FFFFFF;
  --surface: #F6F8FB;
  --card: #FFFFFF;
  --text: #0F1B2D;
  --muted: #4F5E75;
  --line: #E2E7EF;
  --line-strong: #CDD5E1;
  --blue: #1F63C2;
  --blue-dark: #1651A6;
  --blue-soft: #EAF2FC;
  --green: #1B9A5E;
  --orange: #E0701A;
  --red: #E5484D;
  --grey: #8A95A8;
  --radius: 12px;
  --radius-btn: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.04), 0 8px 24px rgba(15, 27, 45, 0.06);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--surface); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); color: var(--text);
  font: 18px/1.6 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.015em; }
h1 { font-size: clamp(28px, 3vw, 38px); font-weight: 750; }
h2 { font-size: 24px; font-weight: 700; }
h3 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
p { margin: 0; }
a { color: var(--blue); }
img { display: block; max-width: 100%; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.95em; }
.wrap { width: min(1240px, 100% - 48px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 15px; margin-top: 16px; }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
main { flex: 1; padding: 32px 0 56px; animation: rise 0.45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* Navigation */
.nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; min-height: 68px; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 19px; font-weight: 600; }
.brand b { color: var(--blue); font-weight: 750; }
.brand img { border-radius: 8px; }
.links { display: flex; gap: 2px; flex-wrap: wrap; }
.links a { position: relative; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 16px; text-decoration: none; transition: background-color 160ms ease, color 160ms ease; }
.links a:hover { background: var(--surface); color: var(--text); }
.links a[aria-current="page"] { color: var(--blue); background: var(--blue-soft); }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.nav-end form { margin: 0; }
.who { display: flex; flex-direction: column; line-height: 1.25; text-align: right; font-size: 14px; }
.who small { color: var(--muted); }
.lang { font-size: 15px; font-weight: 600; text-decoration: none; }
@media (max-width: 860px) { .who { display: none; } .nav { padding: 10px 16px; gap: 10px; } .links { order: 3; width: 100%; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 22px; cursor: pointer;
  border: 1px solid var(--blue); border-radius: var(--radius-btn); background: var(--blue); color: #fff; font: inherit; font-size: 17px; font-weight: 650;
  text-decoration: none; line-height: 1.2; transition: background-color 160ms ease, border-color 160ms ease, transform 120ms var(--ease);
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn:active { transform: scale(0.98); }
.btn-small { min-height: 38px; padding: 6px 14px; font-size: 15px; }
.btn-ghost { background: #fff; color: var(--blue); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--blue-soft); border-color: var(--blue); }
.btn-wide { width: 100%; }
.danger { color: var(--red) !important; }
.btn-ghost.danger:hover { background: #FDECEC; border-color: var(--red); }
.row-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Cards, forms, messages */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.card p + p { margin-top: 10px; }
.empty { text-align: center; padding: 40px 28px; color: var(--muted); }
.empty .btn { margin-top: 18px; }
.form { display: grid; gap: 16px; margin-top: 20px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 16px; }
.form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin: 0; }
.card.form-row { margin-top: 24px; }
.grow { flex: 1 1 240px; }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; font: inherit; font-size: 17px; font-weight: 400; color: var(--text);
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius-btn); transition: border-color 160ms ease, box-shadow 160ms ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
input:disabled { background: var(--surface); color: var(--muted); }
textarea { resize: vertical; }
.code-input { font-size: 28px; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.hp { position: absolute; left: -9999px; }
.flash { margin-bottom: 20px; padding: 14px 18px; border-radius: var(--radius-btn); border: 1px solid; font-weight: 600; animation: rise 0.35s var(--ease) both; }
.flash.ok { background: #E6F6EE; border-color: #BFE6D2; color: #17714A; }
.flash.err { background: #FDECEC; border-color: #F5C2C3; color: #B3262B; }

/* Front page */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; padding: 32px 0 48px; }
.kicker { margin-bottom: 10px; color: var(--blue); font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.hero h1 { font-size: clamp(34px, 4.4vw, 54px); max-width: 18ch; }
.lead { margin-top: 18px; max-width: 52ch; color: var(--muted); font-size: 20px; }
.lead-small { margin-top: 12px; color: var(--muted); font-size: 19px; }
.hero-demo { display: grid; gap: 10px; padding: 20px; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 30px 60px rgba(15, 27, 45, 0.12); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid3 .card p { color: var(--muted); }
.narrow-card { max-width: 720px; margin: 40px auto 0; }
@media (max-width: 900px) { .hero, .grid3 { grid-template-columns: 1fr; } }

/* Log-in pages */
.auth { max-width: 480px; margin: 24px auto; }
.wide-auth { max-width: 560px; }
.auth h1 { font-size: 30px; margin-bottom: 8px; }
.steps { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.num { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--blue); color: #fff; font-weight: 750; font-size: 16px; }
.qr { display: grid; justify-items: center; gap: 8px; margin: 20px 0 8px; }
.qr img { image-rendering: pixelated; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; }
.qr small { color: var(--muted); font-size: 13px; word-break: break-all; text-align: center; }
.secret { display: inline-block; margin-top: 4px; padding: 4px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; letter-spacing: 0.06em; }

/* Page heads */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head .muted { margin-top: 6px; max-width: 70ch; }
.section-title { margin: 40px 0 14px; font-size: 22px; }
.team-pick select { min-width: 260px; font-weight: 600; }

/* The overview */
.stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px; }
.st { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; font-size: 15px; font-weight: 650; }
.st b { font-size: 18px; font-variant-numeric: tabular-nums; }
.st.red { background: #FDE4E5; color: #B3262B; }
.st.orange { background: #FFF0DC; color: #A85808; }
.st.green { background: #E1F5EA; color: #17714A; }
.st.grey { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.refresh { margin-left: auto; font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tile {
  --s: var(--green); position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 16px 14px 16px 16px;
  background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--s); border-radius: 10px;
  transition: background-color 400ms ease, border-color 400ms ease;
}
.tile-main { flex: 1; min-width: 0; }
.tile b { display: block; overflow: hidden; font-size: 17px; white-space: nowrap; text-overflow: ellipsis; }
.tile small { display: block; color: var(--muted); font-size: 14px; line-height: 1.4; }
.tile .label { font-style: italic; }
.dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--s); }
.t-red { --s: var(--red); background: #FFF5F5; border-color: #F5C2C3; }
.t-red .line { color: #B3262B; font-weight: 650; }
.t-red .dot { animation: pulse 1.6s ease-out infinite; }
.t-orange { --s: var(--orange); background: #FFFAF2; }
.t-orange .line { color: #A85808; font-weight: 600; }
.t-grey { --s: var(--grey); }
.t-grey b { color: var(--muted); }
.tile.changed { animation: flashin 1.2s var(--ease); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.55); } 100% { box-shadow: 0 0 0 12px rgba(229, 72, 77, 0); } }
@keyframes flashin { 0% { transform: scale(1.02); box-shadow: 0 0 0 3px var(--s); } 100% { transform: none; box-shadow: none; } }
.hero-demo .tile { animation: none; }

.tile-menu { position: relative; flex: none; }
.tile-menu summary { list-style: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; }
.tile-menu summary::-webkit-details-marker { display: none; }
.tile-menu summary:hover { background: var(--surface); }
.tile-menu form { position: absolute; right: 0; top: 38px; z-index: 5; margin: 0; padding: 6px; background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); }
.menu-item { white-space: nowrap; padding: 8px 12px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 15px; cursor: pointer; }
.menu-item:hover { background: #FDECEC; }

/* Tables and lists */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 16px; }
.table th { padding: 12px 16px; background: var(--surface); text-align: left; font-size: 14px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.actions form { margin: 0; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 650; color: var(--muted); }
.pill-open { background: #E1F5EA; border-color: #BFE6D2; color: #17714A; }
.pill-used { background: var(--blue-soft); border-color: #CFE0F7; color: var(--blue-dark); }
.list { display: grid; gap: 10px; margin-top: 16px; }
.list-row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; }
.list-row form { margin: 0; }

/* The invitation letter, also on paper */
.letter { max-width: 860px; }
.letter h1 { margin-top: 4px; }
.letter-grid { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; margin: 24px 0; }
.big-code { margin-top: 8px; font: 750 34px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0.08em; color: var(--blue-dark); }
@media (max-width: 760px) { .letter-grid { grid-template-columns: 1fr; } }
@media print {
  .nav, .foot, .no-print, .flash { display: none !important; }
  body, html { background: #fff; }
  main { padding: 0; animation: none; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .letter-grid { grid-template-columns: 1fr auto; }
}

.foot { padding: 20px 0; border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  main, .flash, .tile.changed, .t-red .dot { animation: none; }
  .btn, .tile { transition: none; }
}
