/* ── Phase 4 quote→booking + contact UX layer ────────────────────────────────
 *
 * Additive styles for the Next-ported booking wizard and contact form. These add
 * the approved UX improvements (inline error banners + field-level errors,
 * loading/spinner state, focus-visible affordances, ≥16px inputs + 44px touch
 * targets, mobile summary stacking) WITHOUT altering the finalized visual design —
 * they reuse the existing --jsc/legacy design tokens (--leaf, --ink, --line,
 * --coral*, --r-*) and only style new elements (.jas-*) or layer onto existing ones.
 * Loaded last in the page cascade so it never overrides the bespoke chrome.
 */

/* Inline error/success banner (replaces window.alert) — a live region. */
.jas-banner {
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 18px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.jas-banner-error {
  background: var(--coral-soft, #fdecea);
  border: 1px solid var(--coral, #d9534f);
  color: var(--coral-ink, #8a2a23);
}
.jas-banner-success {
  background: var(--leaf-bg, #eef5ec);
  border: 1px solid var(--leaf);
  color: var(--moss, #2f5233);
}
.jas-banner .jas-banner-icon {
  flex-shrink: 0;
  font-weight: 700;
  line-height: 1.3;
}

/* Field-level error text + invalid affordance. */
.jas-field-error {
  color: var(--coral-ink, #8a2a23);
  font-size: 12.5px;
  margin-top: 5px;
  line-height: 1.4;
}
[aria-invalid='true'] {
  border-color: var(--coral, #d9534f) !important;
}
[aria-invalid='true']:focus {
  outline: 2px solid var(--coral, #d9534f);
  outline-offset: 1px;
}

/* Keyboard focus affordance for tiles/slots/days/cleaners + buttons (mouse users
 * keep the existing hover-only look via :focus-visible). */
.jas-focusable:focus-visible,
.tile:focus-visible,
.slot:focus-visible,
.cal-day:focus-visible,
.cleaner:focus-visible,
.addon:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
button:focus-visible,
a.btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* In-flight spinner on the primary action. */
.jas-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  vertical-align: -2px;
  margin-right: 8px;
  animation: jas-spin 0.7s linear infinite;
}
@keyframes jas-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .jas-spinner {
    animation-duration: 1.6s;
  }
}
button[aria-busy='true'] {
  opacity: 0.75;
  cursor: progress;
}

/* Server-quote line items on the success view. */
.jas-quote-lines {
  margin: 18px 0 0;
  width: 100%;
}
.jas-quote-lines .jas-quote-line {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px dashed var(--line-soft);
}
.jas-quote-lines .jas-quote-line.jas-quote-total {
  border-bottom: none;
  border-top: 2px solid var(--ink);
  margin-top: 6px;
  padding-top: 12px;
  font-weight: 600;
  font-size: 16px;
}
.jas-quote-lines .jas-quote-line .jas-quote-amt {
  font-family: var(--mono);
}
.jas-quote-meta {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 12px;
  line-height: 1.5;
}
.jas-estimate-note {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 10px;
  line-height: 1.5;
}

/* No-iOS-zoom inputs + 44px touch targets on the booking surfaces. */
.jas-flow input,
.jas-flow select,
.jas-flow textarea {
  font-size: 16px;
}
.jas-flow .btn,
.jas-flow button {
  min-height: 44px;
}

/* Mobile: stack the sticky booking summary under the panel. */
@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .summary {
    position: static !important;
  }
}
