/*
  Menu change request form — styles.

  Mobile first, because that is where a restaurant operator actually fills
  this in: one column, 16px minimum body text (anything smaller triggers iOS
  input zoom), and 48px minimum tap targets.

  Chowly brand colours, taken from the brand system rather than invented:
    #1B51A4  primary blue
    #001f52  deep navy (headings, body text)
    #3B82F6  bright blue (focus, links)
    #F9E11C  yellow accent (used sparingly — progress + the done tick)
*/

:root {
  --blue: #1B51A4;
  --blue-dark: #163f80;
  --navy: #001f52;
  --navy-soft: #3b4563;
  --bright: #3B82F6;
  --yellow: #F9E11C;

  --ink: #0a2540;
  --ink-soft: #6b7a99;
  --ink-faint: #8b95ad;
  --rule: #e2e8f0;
  --ground: #f8f9fc;
  --ground-2: #f0f3fa;
  --white: #ffffff;

  --danger: #b3261e;
  --danger-soft: #fdecea;
  --ok: #0f7b4f;
  --ok-soft: #e7f5ee;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(10, 37, 64, .06), 0 8px 24px -16px rgba(10, 37, 64, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  /* 16px minimum: iOS zooms the viewport on focus for anything smaller. */
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------- masthead ---------- */
.masthead {
  background: var(--navy);
  color: var(--white);
  padding-top: env(safe-area-inset-top);
}
.masthead-inner {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0.9rem 1.15rem;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.wordmark {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.masthead-title {
  font-size: 0.95rem;
  color: #b9c6de;
}

/* ---------- layout ---------- */
main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1.15rem 3rem;
}

/* ---------- progress ---------- */
.progress { padding: 1.15rem 0 0.35rem; }
.progress-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}
.progress-step {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--ink-faint);
}
.progress-step .dot {
  height: 4px;
  border-radius: 2px;
  background: var(--rule);
  display: block;
}
.progress-step.is-done .dot { background: var(--blue); }
.progress-step.is-current .dot { background: var(--yellow); }
.progress-step.is-current { color: var(--navy); font-weight: 600; }
.dot-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- steps ---------- */
.step {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.25rem 1.5rem;
  margin-top: 0.9rem;
}
.step h1 {
  font-size: 1.32rem;
  line-height: 1.25;
  margin: 0 0 0.45rem;
  color: var(--navy);
  letter-spacing: -0.015em;
}
.lede {
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
  font-size: 0.97rem;
}

/* ---------- fields ---------- */
.field { margin-bottom: 1.35rem; border: 0; padding: 0; }
.field > label, .field > legend, fieldset.field > legend {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  color: var(--navy);
  padding: 0;
}
.optional { font-weight: 400; color: var(--ink-faint); font-size: 0.85rem; }

input[type="text"], input[type="email"], input[type="tel"],
input[type="date"], textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid #cfd8e8;
  border-radius: 8px;
  /* 14px vertical keeps the control at/over 48px tall on a phone. */
  padding: 0.75rem 0.85rem;
  -webkit-appearance: none;
  appearance: none;
}
textarea { resize: vertical; min-height: 8rem; line-height: 1.5; }

input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(59, 130, 246, .35);
  outline-offset: 1px;
  border-color: var(--bright);
}

input[type="file"] {
  width: 100%;
  font: inherit;
  padding: 0.7rem;
  background: var(--ground-2);
  border: 1.5px dashed #b9c6de;
  border-radius: 8px;
}

.hint {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.error {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  color: var(--danger);
  font-weight: 500;
}
.error-block {
  background: var(--danger-soft);
  border: 1px solid #f3c9c5;
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
}
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }

/* ---------- choices ---------- */
.choices { border: 0; padding: 0; margin: 0 0 1.5rem; }
.choices legend {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
  padding: 0;
}
.escape .choices { margin: 0.6rem 0 0; }
.escape .hint { margin-bottom: 0.2rem; }

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  background: var(--white);
  min-height: 48px;
}
.choice:hover { border-color: #b9c6de; background: var(--ground); }
.choice input { margin: 0.2rem 0 0; width: 1.15rem; height: 1.15rem; flex: none; accent-color: var(--blue); }
.choice span { font-size: 0.97rem; }
.choice:has(input:checked) {
  border-color: var(--blue);
  background: #eff4fc;
  box-shadow: inset 0 0 0 1px var(--blue);
}
.choice:has(input:focus-visible) { outline: 3px solid rgba(59, 130, 246, .35); outline-offset: 1px; }

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.95rem;
  min-height: 48px;
  padding: 0.6rem 0;
  cursor: pointer;
}
.checkbox input { margin: 0.15rem 0 0; width: 1.15rem; height: 1.15rem; flex: none; accent-color: var(--blue); }
.severity { color: var(--navy); font-weight: 500; }

/* ---------- escape hatch (step 2's "not a menu change" disclosure) ---------- */
.escape {
  margin: 1.2rem 0 0.6rem;
  border-top: 1px solid var(--rule);
  padding-top: 0.9rem;
}
.escape summary {
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--blue);
  font-weight: 500;
  padding: 0.35rem 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.escape summary:focus-visible { outline: 3px solid rgba(59, 130, 246, .35); outline-offset: 2px; }
.escape .field { margin: 0.7rem 0 0; }

/* ---------- buttons ---------- */
.actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.85rem 1.3rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  min-height: 48px;
  flex: 1 1 auto;
}
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn-primary:disabled { background: #b9c6de; cursor: not-allowed; }
.btn-ghost {
  background: var(--white);
  color: var(--blue);
  border-color: #cfd8e8;
  flex: 0 1 auto;
}
.btn-ghost:hover { background: var(--ground); }
.btn:focus-visible { outline: 3px solid rgba(59, 130, 246, .45); outline-offset: 2px; }
#find-btn { margin-bottom: 0.2rem; }

/* ---------- file chosen ---------- */
.file-chosen {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  background: var(--ok-soft);
  border: 1px solid #bfe3d0;
  border-radius: 6px;
  padding: 0.6rem 0.7rem;
  color: #0f5c3d;
}

/* ---------- summary ---------- */
.summary {
  background: var(--ground-2);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
}
.summary dl { margin: 0; display: grid; gap: 0.35rem 0.8rem; }
@media (min-width: 26rem) {
  .summary dl { grid-template-columns: 8rem 1fr; }
}
.summary dt { color: var(--ink-soft); }
.summary dd { margin: 0; color: var(--navy); font-weight: 500; }

/* ---------- done ---------- */
.done { text-align: center; padding: 2.2rem 1.25rem 2.4rem; }
.tick {
  width: 3.2rem;
  height: 3.2rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--navy);
  font-size: 1.7rem;
  line-height: 3.2rem;
  font-weight: 700;
}
.done .lede { margin-bottom: 1.1rem; }
.reference {
  font-size: 1.02rem;
  margin: 0 0 0.4rem;
}
.reference strong {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.04em;
  background: var(--ground-2);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
}

/* ---------- footer ---------- */
.footer {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1.15rem 2.5rem;
  font-size: 0.87rem;
  color: var(--ink-soft);
  text-align: center;
}
.footer a { color: var(--blue); }

/* ---------- utilities ---------- */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
[hidden] { display: none !important; }

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