/* ACD FirstPage — Associated Controls + Design branding (acdtheatrical.com). */
:root {
  --ink: #17242a;
  --ink-2: #24353c;
  --paper: #f4f4f0;
  --card: #ffffff;
  --muted: #5f6b70;
  --line: #d9dcd6;
  --line-strong: #b9bfba;
  --red: #e52739;
  --blue: #0655a5;
  --blue-dark: #04437f;
  --green: #00a461;
  --amber: #a85f00;
  --amber-bg: #fff3df;
  --error: #c4202f;
  --error-bg: #fdecee;
  --radius: 6px;
  --focus: 0 0 0 3px rgba(6, 85, 165, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── header ─────────────────────────────────────────────────────────────── */
.fp-header { background: var(--ink); color: #fff; }
.fp-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  max-width: 1180px; margin: 0 auto; padding: 18px 24px;
}
.fp-logo img { display: block; width: clamp(170px, 30vw, 230px); height: auto; }
.fp-header__meta { display: grid; text-align: right; font-size: .8rem; color: #aab5b7; }
.fp-header__meta a { color: #fff; font-weight: 600; text-decoration: none; }
.fp-header__meta a:hover { text-decoration: underline; }
.fp-stripe { display: grid; grid-template-columns: repeat(3, 1fr); height: 5px; }
.fp-stripe i:nth-child(1) { background: var(--red); }
.fp-stripe i:nth-child(2) { background: var(--blue); }
.fp-stripe i:nth-child(3) { background: var(--green); }

/* ── intro ──────────────────────────────────────────────────────────────── */
.fp-main { max-width: 1180px; margin: 0 auto; padding: 0 24px 72px; }
.fp-intro { padding: 48px 0 32px; max-width: 780px; }
.fp-kicker { margin: 0 0 10px; color: var(--green); font-size: .74rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.fp-intro h1 { margin: 0 0 16px; font-size: clamp(2.1rem, 5.4vw, 3.4rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 750; }
.fp-lede { margin: 0 0 14px; color: var(--ink-2); font-size: 1.08rem; line-height: 1.6; }
.fp-notes { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--muted); font-size: .88rem; }
.req { color: var(--red); font-weight: 700; }

/* ── layout ─────────────────────────────────────────────────────────────── */
.fp-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 32px; align-items: start; }
.fp-toc { position: sticky; top: 20px; }
.fp-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; border-left: 2px solid var(--line); }
.fp-toc li { counter-increment: toc; }
.fp-toc a {
  display: block; padding: 7px 0 7px 14px; margin-left: -2px; border-left: 2px solid transparent;
  color: var(--muted); font-size: .88rem; font-weight: 600; text-decoration: none;
}
.fp-toc a::before { content: counter(toc, decimal-leading-zero) "  "; color: var(--line-strong); font-variant-numeric: tabular-nums; }
.fp-toc a:hover { color: var(--ink); border-left-color: var(--blue); }

.fp-form { display: grid; gap: 20px; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px clamp(18px, 3vw, 32px) 28px; }
.card__head { display: flex; align-items: baseline; gap: 14px; margin: 0 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.card__num { color: var(--green); font-size: .78rem; font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.card h2 { margin: 0; font-size: 1.4rem; letter-spacing: -.02em; }
.sub { margin: 26px 0 12px; font-size: 1rem; font-weight: 700; }
.sub--tight { margin: 0 0 4px; }
.hint { margin: 0 0 14px; color: var(--muted); font-size: .9rem; }
.hint--empty { margin: 10px 0 0; font-style: italic; }

/* ── grid & fields ──────────────────────────────────────────────────────── */
.grid { display: grid; gap: 16px 18px; margin-bottom: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.field { display: block; min-width: 0; margin: 0; padding: 0; border: 0; font-size: .86rem; font-weight: 650; color: var(--ink-2); }
.field > input, .field > textarea, .field > .addr__row, .field > .sig { display: block; margin-top: 6px; }
.field > small { display: block; margin-top: 5px; }
.field > .addr__row { display: flex; }
.card > label.field, .card > fieldset.field { margin-bottom: 18px; }
.grid > .field { margin-bottom: 0; }   /* grid gap handles spacing; extra margins made uneven gaps when stacked */
.field legend, .field__label { padding: 0; margin-bottom: 8px; font-size: .86rem; font-weight: 650; color: var(--ink-2); }
.field small { font-weight: 500; color: var(--muted); font-size: .78rem; }
input:not([type=checkbox]):not([type=radio]), textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: 5px; background: #fff;
  color: var(--ink); font: inherit; font-size: 1rem; font-weight: 450;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 76px; line-height: 1.45; }
/* iOS Safari gives native date/time inputs an intrinsic min-width (they ignore width:100% and overflow
   narrow containers) plus centered, extra-tall value boxes. Strip the native appearance and reset. */
input[type=date], input[type=time] {
  -webkit-appearance: none; appearance: none;
  display: block; min-width: 0; max-width: 100%; height: 44px; line-height: 1.4; text-align: left;
}
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { margin: 0; text-align: left; }
input[type=date]::-webkit-datetime-edit, input[type=time]::-webkit-datetime-edit { padding: 0; }
.ready__date input { height: 38px; }
input:focus, textarea:focus, button:focus-visible, .pill input:focus-visible + span { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
input[readonly] { background: #f2f3f0; color: var(--muted); }
input::placeholder, textarea::placeholder { color: #9aa3a6; }

.has-error input:not([type=checkbox]):not([type=radio]), .has-error textarea { border-color: var(--error); background: #fffafa; }
.err { display: block; color: var(--error); font-size: .8rem; font-weight: 600; margin-top: 2px; }
.has-error.sig { border-color: var(--error); }

/* ── pills (radio) ──────────────────────────────────────────────────────── */
.pills { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.pill { position: relative; cursor: pointer; }
.pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pill span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: #fff;
  font-size: .9rem; font-weight: 600; color: var(--ink-2); transition: all .15s;
}
.pill:hover span { border-color: var(--ink-2); }
.pill input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill--sm span { min-height: 34px; padding: 5px 12px; font-size: .84rem; }

/* ── checks ─────────────────────────────────────────────────────────────── */
.checks { display: grid; gap: 8px; margin-bottom: 4px; }
.checks.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.checks.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check {
  position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 5px; background: #fff; cursor: pointer;
  font-size: .92rem; font-weight: 550; color: var(--ink-2); transition: border-color .15s, background .15s;
}
.check:hover { border-color: var(--line-strong); }
.check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--green); cursor: pointer; }
.check:has(input:checked) { border-color: var(--green); background: #effaf4; color: var(--ink); }
.check:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.check--none { margin-top: 10px; }
.check--ack { margin-bottom: 18px; padding: 16px; line-height: 1.5; }
.check.has-error { border-color: var(--error); background: var(--error-bg); flex-wrap: wrap; }
.check.has-error .err { flex-basis: 100%; padding-left: 30px; }

/* ── contacts ───────────────────────────────────────────────────────────── */
.contact { margin: 0 0 18px; padding: 16px 16px 6px; border: 1px solid var(--line); border-radius: 5px; }
.contact legend { padding: 0 6px; font-weight: 700; font-size: .95rem; }
.contact legend small { margin-left: 6px; color: var(--muted); font-weight: 500; font-size: .8rem; }
.contact .grid { margin-bottom: 8px; }
.contact > .linkbtn { margin-bottom: 10px; }
.contact > .linkbtn + .linkbtn { margin-left: 18px; }
.linkbtn { padding: 4px 0; border: 0; background: none; color: var(--blue); font: inherit; font-size: .86rem; font-weight: 650; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--blue-dark); }

/* ── address ────────────────────────────────────────────────────────────── */
.addr { margin-bottom: 18px; }
.addr__row { display: flex; gap: 10px; }
.combo { position: relative; flex: 1; min-width: 0; }
.combo__list {
  position: absolute; z-index: 1200; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px;
  list-style: none; background: #fff; border: 1px solid var(--line-strong); border-radius: 6px;
  box-shadow: 0 14px 34px rgba(23, 36, 42, .16); max-height: 300px; overflow: auto;
}
.combo__opt { padding: 10px 12px; border-radius: 4px; font-size: .92rem; font-weight: 500; cursor: pointer; }
.combo__opt:hover, .combo__opt.is-active { background: #eef3fa; }
.addr__status { margin: 4px 0 0; min-height: 1.3em; font-size: .86rem; font-weight: 600; color: var(--muted); }
.addr__status.is-verified { color: var(--green); }
.addr__status.is-approximate, .addr__status.is-manual { color: var(--amber); }
.addr__status.is-notfound { color: var(--error); }

/* ── buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px;
  border-radius: 5px; border: 1px solid transparent; font: inherit; font-size: .95rem; font-weight: 700; cursor: pointer;
  white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn--primary { background: var(--blue); color: #fff; min-height: 52px; padding: 12px 28px; font-size: 1.02rem; }
.btn--primary:hover { background: var(--blue-dark); }
.btn--primary:disabled { opacity: .6; cursor: progress; }
.btn--ghost { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }

/* ── map ────────────────────────────────────────────────────────────────── */
.mapbox { margin: 8px 0 22px; padding: 18px; background: #f7f8f5; border: 1px solid var(--line); border-radius: var(--radius); }
.mapbox__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.mapbox__head .hint { margin: 0; }
.seg { display: inline-flex; flex: none; padding: 3px; background: #fff; border: 1px solid var(--line-strong); border-radius: 6px; }
.seg__btn { padding: 6px 12px; border: 0; border-radius: 4px; background: none; font: inherit; font-size: .82rem; font-weight: 650; color: var(--muted); cursor: pointer; }
.seg__btn.is-on { background: var(--ink); color: #fff; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.tool {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px 6px 7px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: #fff;
  font: inherit; font-size: .86rem; font-weight: 650; color: var(--ink); cursor: pointer;
}
.tool:hover { border-color: var(--ink); }
.tool.is-on { border-color: var(--blue); box-shadow: var(--focus); }
.tool--site { margin-left: auto; }
.dot, .pin {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  color: #fff; font-size: .78rem; font-weight: 800; line-height: 1;
}
.dot--site, .pin--site { background: var(--red); }
.dot--parking, .pin--parking { background: var(--blue); }
.dot--entrance, .pin--entrance { background: var(--green); }
.dot--loading, .pin--loading { background: #d9822b; }
.dot--checkin, .pin--checkin { background: #7a4bc2; }
.dot--other, .pin--other { background: #5a666b; }
.placing { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 8px 12px; background: #eaf1fb; border-radius: 5px; color: var(--blue-dark); font-size: .88rem; font-weight: 650; }
.map { height: clamp(320px, 52vh, 480px); border-radius: 5px; border: 1px solid var(--line-strong); background: #dfe3e0; z-index: 0; }
.map.is-placing, .map.is-placing .leaflet-interactive { cursor: crosshair; }
.pin-wrap { background: none; border: 0; }
.pin-wrap .pin { width: 30px; height: 30px; border: 2.5px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .45); font-size: .85rem; }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { font-size: 10px; }

.markers { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.markers__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 5px; }
.markers__num { border: 0; cursor: pointer; }
.markers__body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 4px 10px; align-items: center; }
.markers__type { grid-column: 1 / -1; font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.markers__body input { min-height: 38px; padding: 7px 10px; font-size: .92rem; }

/* ── readiness ──────────────────────────────────────────────────────────── */
.ready { display: grid; margin-bottom: 20px; border-top: 1px solid var(--line); }
.ready__row {
  display: grid; grid-template-columns: minmax(180px, 1.2fr) auto 150px minmax(140px, 1fr);
  gap: 10px 14px; align-items: center; margin: 0; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line);
}
.ready__label { float: left; padding: 0; font-size: .94rem; font-weight: 650; }
.ready__date input, .ready__note input { min-height: 38px; padding: 7px 10px; font-size: .92rem; }
.ready__row:not(:has(.ready__date:not([hidden]))) .ready__note { grid-column: 3 / -1; }
.ready__row.has-error { background: var(--error-bg); padding-left: 10px; padding-right: 10px; }
.ready__row .err { grid-column: 1 / -1; }

/* ── orientation ────────────────────────────────────────────────────────── */
.cond { margin: 6px 0 18px; padding: 18px; border-left: 3px solid var(--blue); background: #f6f9fd; border-radius: 0 5px 5px 0; }
.cond > .field { margin-bottom: 16px; }
.subcard { margin: 0 0 16px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 5px; }
.subcard .grid { margin: 12px 0 0; }
.cond .contact { background: #fff; margin-bottom: 0; }

/* ── signature ──────────────────────────────────────────────────────────── */
.sig { position: relative; height: 170px; border: 1px dashed var(--line-strong); border-radius: 5px; background: #fff; touch-action: none; }
.sig canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.sig::after { content: ""; position: absolute; left: 24px; right: 24px; bottom: 42px; border-bottom: 1px solid var(--line); pointer-events: none; }
.sig__hint { position: absolute; left: 24px; bottom: 16px; color: #9aa3a6; font-size: .84rem; font-weight: 500; pointer-events: none; }
.sig.has-ink .sig__hint { display: none; }
.sig__clear { position: absolute; top: 8px; right: 12px; }
.sig .err { position: absolute; left: 24px; top: 10px; }

/* ── errors / actions / done ────────────────────────────────────────────── */
.callout { margin: 0 0 16px; padding: 12px 14px; border-radius: 5px; font-size: .9rem; font-weight: 600; }
.callout--warn { background: var(--amber-bg); color: var(--amber); }
.landing { max-width: 640px; margin: 0 0 40px; }
.landing .card__head { margin-bottom: 12px; }
.landing form > .field { margin-bottom: 18px; }
.lk-status { min-height: 1.4em; margin: 0; font-size: .92rem; font-weight: 600; color: var(--muted); }
.lk-status.is-ok { padding: 12px 14px; border-radius: 5px; background: #effaf4; color: #00703f; }
.lk-status.is-err { color: var(--error); }
.lk-resume { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: .92rem; color: var(--ink-2); }
.callout--info { margin: 18px 0 0; background: #eaf1fb; color: var(--blue-dark); border-left: 3px solid var(--blue); }
.callout--info.is-miss { background: var(--amber-bg); color: var(--amber); border-left-color: var(--amber); }
.errors { margin: 22px 0 0; padding: 14px 16px; background: var(--error-bg); border: 1px solid #f3c2c8; border-radius: 5px; color: var(--error); font-size: .9rem; }
.errors ul { margin: 8px 0 0; padding-left: 18px; }
.errors a { color: var(--error); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 24px; }

.done { max-width: 640px; margin: 56px auto 0; padding: 44px clamp(20px, 5vw, 48px); text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); outline: none; }
.done__icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; background: var(--green); color: #fff; font-size: 1.9rem; font-weight: 800; }
.done h2 { margin: 0 0 12px; font-size: 1.7rem; letter-spacing: -.02em; }
.done p { color: var(--ink-2); line-height: 1.6; }
.done__id { color: var(--muted); font-size: .92rem; }
.done .actions { justify-content: center; }

.fp-footer { display: flex; justify-content: space-between; gap: 16px; max-width: 1180px; margin: 0 auto; padding: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; font-weight: 600; letter-spacing: .04em; }
.fp-footer a { color: var(--muted); }

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .fp-layout { grid-template-columns: minmax(0, 1fr); }
  .fp-toc { display: none; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ready__row { grid-template-columns: minmax(0, 1fr) auto; }
  .ready__label { grid-column: 1 / -1; }
  .ready__row .pills { grid-column: 1 / -1; }
  .ready__date { grid-column: 1; }
  .ready__note, .ready__row:not(:has(.ready__date:not([hidden]))) .ready__note { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .fp-header__inner, .fp-main, .fp-footer { padding-left: 16px; padding-right: 16px; }
  .fp-header__meta span { display: none; }
  .fp-header__meta { font-size: .74rem; }
  .fp-intro { padding-top: 32px; }
  .g2, .g3, .g4, .checks.g2, .checks.g3 { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
  .addr__row { flex-direction: column; }
  .mapbox { padding: 12px; margin-left: -8px; margin-right: -8px; }
  .mapbox__head { flex-direction: column; }
  .tool--site { margin-left: 0; }
  .markers__body { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 20px 16px 22px; }
  .fp-footer { flex-direction: column; }
  .btn--primary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
