/* FindMyDoor: one small stylesheet, no build step. Mobile first. */

:root {
  --ink: #1b1d1f;
  --muted: #5b6168;
  --line: #d9dde1;
  --paper: #ffffff;
  --wash: #f4f5f6;
  --brand: #0b5cad;
  --brand-ink: #ffffff;
  --ok: #17663a;
  --ok-wash: #e6f4ec;
  --warn: #8a4b00;
  --warn-wash: #fff3e0;
  --bad: #a3231c;
  --bad-wash: #fdeceb;
  --radius: 10px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

a { color: var(--brand); }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 16px; }

/* Header */
.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; margin-right: auto; }
.top nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.top nav form { margin: 0; }

main { padding: 20px 0 40px; }
footer { color: var(--muted); font-size: .9rem; padding: 0 0 32px; }

/* Cards and lists */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.list { list-style: none; padding: 0; margin: 0; }
.list > li { padding: 12px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 0; }

/* Messages */
.notice { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; }
.notice-ok { background: var(--ok-wash); color: var(--ok); }
.notice-warn { background: var(--warn-wash); color: var(--warn); }
.notice-bad { background: var(--bad-wash); color: var(--bad); }
.badge { display: inline-block; font-size: .8rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--wash); color: var(--muted); }
.badge-ok { background: var(--ok-wash); color: var(--ok); }
.badge-warn { background: var(--warn-wash); color: var(--warn); }

/* Forms */
label { display: block; font-weight: 600; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.hint { font-weight: 400; color: var(--muted); font-size: .9rem; }
.error { color: var(--bad); font-size: .95rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; color: inherit; background: var(--paper);
  border: 1px solid #aab1b8; border-radius: 8px; padding: 10px 12px;
}
input[type=file] { font: inherit; max-width: 100%; }
textarea { min-height: 4.5rem; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus { outline: 3px solid #8cc0f5; outline-offset: 1px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 5px; }

.btn {
  display: inline-block; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand);
  border-radius: 8px; padding: 10px 16px; min-height: 44px;
}
.btn-quiet { background: var(--paper); color: var(--brand); border-color: #aab1b8; }
.btn-danger { background: var(--paper); color: var(--bad); border-color: #e3aaa6; }
.btn-small { padding: 6px 10px; min-height: 36px; font-size: .95rem; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn[disabled] { opacity: .6; cursor: default; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }

/* Tables (admin) */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .85rem; color: var(--muted); border-top: 0; }

/* Direction steps (resident editor) */
.step { display: grid; grid-template-columns: 96px 1fr; gap: 12px; }
.step img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; background: var(--wash); }

/* Rider pages */
.rider main { padding-top: 16px; }
.rider-head { margin-bottom: 16px; }
.rider-head .where { color: var(--muted); }
.big-input { font-size: 1.6rem !important; text-align: center; letter-spacing: .05em; text-transform: uppercase; padding: 14px !important; }
.route { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.route li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.route img { display: block; width: 100%; height: auto; background: var(--wash); }
.route .caption { padding: 12px 14px; font-size: 1.1rem; }
.route .num { display: inline-block; min-width: 1.8em; height: 1.8em; line-height: 1.8em; text-align: center; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: .95rem; margin-right: 8px; }
.final { background: var(--ok-wash); color: var(--ok); border-radius: var(--radius); padding: 14px; font-size: 1.1rem; font-weight: 600; margin-bottom: 14px; }
.preview-bar { background: var(--warn-wash); color: var(--warn); padding: 10px 0; font-weight: 600; }

/* Rider pages follow the phone's dark mode: no glaring white screen at night. */
@media (prefers-color-scheme: dark) {
  body.rider {
    --ink: #e8eaed;
    --muted: #a6adb4;
    --line: #3a3f45;
    --paper: #1e2226;
    --wash: #121518;
    --brand: #6cb0f5;
    --brand-ink: #0b1a2a;
    --ok: #8fd8ab;
    --ok-wash: #16301f;
    --warn: #f3c27a;
    --warn-wash: #33260f;
    --bad: #f3a19b;
    --bad-wash: #3a1916;
  }
  body.rider input[type=text] { border-color: #5a6168; }
}

/* Printable sign */
.sign { text-align: center; max-width: 160mm; margin: 0 auto; padding: 24px 16px; background: #fff; }
.sign img { width: 100%; max-width: 110mm; height: auto; }
.sign .call { font-size: 1.8rem; font-weight: 800; margin: 8px 0 0; }
.sign .place { font-size: 1.3rem; margin: 8px 0 0; }
.sign .url { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; color: var(--muted); word-break: break-all; }
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
}
