/* Task 89: shared v10 form components. Tasks 90/91 use these same classes.
   Loaded after app.css; v9 tokens only. */

:root {
  --ink: #102A33;
  --muted: #56707A;
  --line: #E2EAEE;
  --bg: #F3F8FA;
  --card: #FFFFFF;
  --accent: #0F766E;
  --accent-ink: #115E59;
  --accent-soft: #E6FAF6;
  --accent-bright: #14B8A6;
  --blue: #0369A1;
  --blue-soft: #E8F4FD;
  --sky: #38BDF8;
  --sky-pale: #7DD3FC;
  --teal-glow: #5EEAD4;
}

/* ---- Fields: label above, hint + error below ---- */
.field { margin: 0 0 20px; }
.field > .field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.field > .field-label .icon { width: 16px; height: 16px; }
.field > .field-label .req { color: var(--red); }
/* Task 150: the "Required" hint shows on phones only (labels go
   normal-case there); laptops keep the uppercase label + star. */
.req-hint { display: none; }
.field-input { max-width: 100%; }
.field-input[aria-invalid="true"] { border-color: var(--red); }
.field-input[aria-invalid="true"]:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}
.field-hint {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}
.field-error {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--red);
  font-weight: 600;
}

/* ---- Form cards: white card like the homepage search card ---- */
.form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px;
  margin: 0 0 24px;
}
.form-card-head { margin-bottom: 16px; }
.form-card-head h2 { margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.form-card-head .muted { margin: 0; }

/* ---- Action bar: primary right on laptop, sticky full-width on phones ---- */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  color: var(--ink);
}
.action-bar .btn,
.action-bar .pill {
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.action-bar .bar-total {
  margin-right: auto;
  font-size: 1.3rem;
  font-weight: 800;
  white-space: nowrap;
  color: var(--ink);
}
.action-bar .bar-total small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* ---- Error summary + toast ---- */
.error-summary {
  background: var(--red-soft);
  border: 1.5px solid var(--red);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 20px;
}
.error-summary-title {
  margin: 0 0 6px;
  font-weight: 800;
  color: var(--red);
}
.error-summary ul { margin: 0; padding-left: 20px; }
.error-summary li { margin: 2px 0; }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 12px 20px;
  margin: 0 0 20px;
  font-weight: 700;
  box-shadow: var(--shadow-lift);
}
.toast .icon { color: #fff; }

/* ---- "More options" disclosure ---- */
.more {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin: 0 0 24px;
}
.more > summary {
  min-height: var(--tap);
  display: flex;
  align-items: center;
  padding: 12px 16px;
  font-weight: 700;
  color: var(--accent-ink);
  cursor: pointer;
}
.more-body { padding: 4px 16px 16px; }

/* ---- v10 page + section heads (homepage rhythm) ---- */
.v10-head { margin: 0 0 24px; }
.v10-eyebrow {
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.v10-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.v10-sub { margin: 0; color: var(--muted); }
.v10-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.v10-sec { margin: 0 0 40px; }
.v10-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.v10-sec-head h2 { margin: 0; font-size: 22px; font-weight: 800; }
.v10-sec-head .muted { margin: 2px 0 0; }
.v10-more { font-weight: 700; white-space: nowrap; }
@media (min-width: 900px) {
  .v10-title { font-size: 32px; }
  .v10-head.has-actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
  }
  .v10-head.has-actions .v10-actions { margin-top: 0; }
  .v10-sec { margin-bottom: 56px; }
  .v10-sec-head h2 { font-size: 26px; }
}

/* ---- Multi-step forms: one long form without JS, stepped with JS ---- */
.step-pane { border: 0; margin: 0; padding: 0; min-width: 0; }
.step-nav { display: none; }
.js-steps .step-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}
.js-steps .step-pane:not(.is-on) { display: none; }
.js-steps .step-nav .btn,
.step-finish .btn {
  min-height: var(--tap);
  flex: 1;
}
@media (min-width: 900px) {
  .js-steps .step-nav .btn { flex: 0 1 auto; min-width: 160px; }
}

/* ---- Opening-hours day editor ---- */
.hours-day {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px 12px;
  margin: 0 0 12px;
  background: #fff;
}
.hours-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--tap);
}
.hours-top strong { font-size: 16px; }
.day-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  font-weight: 700;
  cursor: pointer;
}
.day-toggle input { width: 22px; height: 22px; }
.day-toggle .when-open { display: none; color: var(--green); }
.day-toggle input:not(:checked) ~ .when-open { display: inline; }
.day-toggle input:not(:checked) ~ .when-closed { display: none; }
.day-toggle .when-closed { color: var(--muted); }
.slot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.slot-grid .field { margin-bottom: 4px; }
.slot-grid input[type="time"] { min-width: 0; width: 100%; }
.hours-day.is-closed .slot-grid { display: none; }

/* ---- Quantity steppers: 48px targets ---- */
[data-stepper] button {
  min-width: var(--tap);
  min-height: var(--tap);
}
[data-stepper] input {
  min-height: var(--tap);
  text-align: center;
}

/* ---- Chips rows scroll sideways on phones ---- */
.chips-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
}
.chips-row .chip { flex: none; }

/* ---- Phones: sticky action bar above the bottom nav ---- */
@media (max-width: 899.98px) {
  .action-bar {
    position: sticky;
    bottom: 12px;
    z-index: 8;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 -8px 24px rgba(41, 45, 52, 0.14);
    padding: 12px;
    margin-left: 0;
    margin-right: 0;
    justify-content: stretch;
  }
  body:has(.bnav) .action-bar {
    /* Task 57/58 lift rule: shared nav height + 8px gap, above bnav z 7. */
    bottom: calc(var(--bnav-h) + 8px);
  }
  .action-bar .btn,
  .action-bar .pill { width: 100%; flex: 1 1 100%; }
  .action-bar .bar-total {
    flex: 1 1 100%;
    margin: 0 0 4px;
    text-align: center;
  }
  .v10-actions .btn,
  .v10-actions .pill { width: 100%; }
  .slot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 359.98px) {
  .slot-grid { grid-template-columns: 1fr; }
}

/* Task 150: labels on phones use normal case with a small "Required"
   hint instead of ALL CAPS with a squeezed-in star. */
@media (max-width: 700px) {
  .field > .field-label {
    text-transform: none;
    letter-spacing: normal;
    font-size: 14px;
  }
  .field > .field-label .req { display: none; }
  .field > .field-label .req-hint {
    display: inline;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: capitalize;
    color: var(--muted);
  }
}
