/* =========================================================
   Yo-Mat Measurement Wizard — styles
   Reuses design tokens from ../styles.css (:root)
   ========================================================= */

.wizard-body { background: var(--cream); min-height: 100vh; }

/* .gate-screen and .wizard-app below set their own unconditional `display`,
   which otherwise beats the browser's default [hidden]{display:none} rule
   regardless of specificity (author styles always win over UA styles) —
   silently leaving both visible at once no matter what JS sets .hidden to. */
[hidden] { display: none !important; }

/* ---------- Password gate ---------- */
.gate-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gate-card {
  max-width: 380px;
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
}
.gate-logo { margin: 0 auto 16px; }
.gate-card h1 { font-size: 1.4rem; margin-bottom: 0.5em; }
.gate-lead { color: var(--walnut-soft); margin-bottom: 1.5em; }
#gateForm { display: flex; flex-direction: column; gap: 12px; }
#gatePassword {
  padding: 0.85em 1em;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--cream);
  color: var(--ink);
  text-align: center;
}
#gatePassword:focus { outline: none; border-color: var(--clay-dark); }
.gate-error { color: var(--error); font-size: 0.9rem; margin: 0; }
.gate-show-password {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-size: 0.85rem;
  color: var(--walnut-soft);
  cursor: pointer;
}
.gate-show-password input { width: 16px; height: 16px; }
.gate-home-link {
  display: inline-block;
  margin-top: 1.5em;
  font-size: 0.85rem;
  color: var(--walnut-soft);
  text-decoration: underline;
}
.gate-home-link:hover { color: var(--clay-dark); }

/* ---------- Wizard shell ---------- */
.wizard-app { display: flex; flex-direction: column; min-height: 100vh; }

.wizard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.wizard-topbar .brand { display: flex; align-items: center; gap: 0.5em; }
.wizard-topbar .brand-name { font-family: var(--font-head); font-weight: 600; color: var(--walnut); }
.wizard-start-over {
  background: none;
  border: none;
  color: var(--walnut-soft);
  font-size: 0.85rem;
  text-decoration: underline;
  padding: 8px;
}
.wizard-start-over:hover { color: var(--clay-dark); }

.wizard-progress { padding: 12px 20px 0; }
.wizard-progress-track {
  height: 4px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.wizard-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--clay);
  transition: width 0.25s ease;
}
.wizard-progress-label {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--walnut-soft);
  text-align: center;
}

.wizard-main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 24px 20px 120px;
}
#wizardForm { width: 100%; max-width: 560px; }

.wizard-step { display: none; }
.wizard-step.is-active { display: block; animation: wizardFadeIn 0.2s ease; }
@keyframes wizardFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.wizard-step h2 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem); max-width: none; }
.wizard-step .eyebrow { font-size: 0.75rem; margin-bottom: 0.75em; }
.wizard-step .section-lead { max-width: none; margin-bottom: 1.5em; }

/* ---------- Form fields ---------- */
.field { margin-bottom: 1.5em; }
.field label, .field legend {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--walnut);
  margin-bottom: 0.5em;
}
.field .optional { font-weight: 400; color: var(--walnut-soft); }
fieldset.field { border: none; padding: 0; margin: 0 0 1.5em; }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], textarea {
  width: 100%;
  padding: 0.85em 1em;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--paper);
  color: var(--ink);
  min-height: 48px;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--clay-dark); }

.radio-row { display: flex; flex-wrap: wrap; gap: 12px; }
.radio-option, .checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
  padding: 0.85em 1.1em;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  min-height: 48px;
}
.radio-option { flex: 1; min-width: 140px; align-items: center; justify-content: center; }
.radio-option input, .checkbox-option input { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.checkbox-option { line-height: 1.5; }
.disclaimer-check { font-size: 1rem; }

.print-text-field { margin-top: 1em; }
.char-count { font-size: 0.82rem; color: var(--walnut-soft); margin: 0.4em 0 0; }

.hint-note { color: var(--walnut-soft); font-size: 0.92rem; }

.landmark-list, .measure-instructions {
  list-style: decimal;
  padding-left: 1.4em;
  margin: 0 0 1.2em;
  color: var(--ink);
}
.landmark-list li, .measure-instructions li { margin-bottom: 0.6em; }

.landmark-detail { margin-top: 0.4em; }
.landmark-detail summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
  color: var(--clay-dark);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: underline;
}
.landmark-detail summary::-webkit-details-marker { display: none; }
.landmark-detail summary:hover { color: var(--walnut); }
.landmark-detail ul {
  list-style: disc;
  padding-left: 1.3em;
  margin: 0.6em 0 0;
  color: var(--walnut-soft);
  font-size: 0.9rem;
}
.landmark-detail ul li { margin-bottom: 0.4em; }

/* ---------- Measurement inputs ---------- */
.measurement-input-row { display: flex; align-items: center; gap: 10px; }
.measurement-input-row input { max-width: 180px; }
.unit-suffix {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--walnut-soft);
}
.field-error { color: var(--error); font-size: 0.88rem; margin: 0.5em 0 0; }

.range-warning {
  margin-top: 0.85em;
  padding: 0.85em 1em;
  background: var(--cream-alt);
  border: 1px solid var(--clay);
  border-radius: var(--radius-sm);
}
.range-warning p { margin: 0 0 0.6em; font-size: 0.9rem; color: var(--walnut); }
.btn-sm { padding: 0.5em 1em; font-size: 0.85rem; }

.range-footnote {
  margin-top: 1.8em;
  font-size: 0.75rem;
  color: var(--walnut-soft);
  line-height: 1.5;
}

/* ---------- Review ---------- */
.review-content { margin-bottom: 2em; }
.review-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 16px;
  background: var(--paper);
}
.review-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6em;
}
.review-group-head h3 { font-size: 1rem; margin: 0; }
.review-edit-link { font-size: 0.85rem; color: var(--clay-dark); text-decoration: underline; background: none; border: none; padding: 4px; }
.review-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 0.92rem; }
.review-row dt { color: var(--walnut-soft); font-weight: 400; }
.review-row dd { margin: 0; font-weight: 500; text-align: right; }
.review-warning-note { color: var(--error); font-size: 0.85rem; margin-top: 0.4em; }

/* ---------- Submit panel ---------- */
.submit-panel { text-align: center; }
.submit-btn { width: 100%; }
.submit-loading { color: var(--walnut-soft); margin-top: 1em; }
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--clay-dark);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.submit-success { color: var(--walnut); margin-top: 1em; }
.submit-success-icon { width: 32px; height: 32px; color: var(--clay-dark); margin: 0 auto 0.5em; }
.submit-note-list { text-align: left; color: var(--walnut); font-size: 0.88rem; background: var(--cream-alt); border: 1px solid var(--clay); border-radius: var(--radius-sm); padding: 12px 16px 12px 32px; margin-top: 1em; }
.submit-error { margin-top: 1em; }
.submit-error p { color: var(--error); margin-bottom: 0.8em; }
.submit-error-list { text-align: left; color: var(--error); font-size: 0.88rem; }
.submit-confirm-actions { display: flex; gap: 12px; margin-top: 1em; }
.submit-confirm-actions .btn { flex: 1; }

/* ---------- Bottom nav ---------- */
.wizard-nav {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.wizard-nav .btn { flex: 1; max-width: 220px; }
.wizard-nav .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

@media (min-width: 640px) {
  .wizard-nav { max-width: 560px; margin: 0 auto; width: 100%; left: 0; right: 0; }
}

/* ---------- Mat render screen ---------- */
.mat-render-screen {
  display: none;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  text-align: center;
}
.mat-render-screen.is-active { display: block; animation: wizardFadeIn 0.2s ease; }
.mat-render-screen .section-lead { max-width: none; margin: 0 auto 1.5em; }

.mat-render-container {
  display: flex;
  justify-content: center;
  margin: 0 auto 1.5em;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
}
/* A 24x72in mat is tall and narrow — cap height, not width, so it never
   overflows the viewport on a normal phone screen. aspect-ratio is set
   explicitly (rather than relying on the svg's own width/height/viewBox
   attributes alone) so the shape is correct even if a browser's intrinsic-
   size handling for inline SVG falls back to something else. */
.mat-render-container svg {
  display: block;
  width: auto;
  max-width: 100%;
  height: min(70vh, 640px);
  aspect-ratio: 1 / 3;
}

.mat-approve-panel { max-width: 320px; margin: 0 auto; }
.mat-approve-actions { display: flex; flex-direction: column; gap: 12px; }
.mat-approve-actions .btn { width: 100%; }
