/* ==========================================================================
   Buttons — Section 5 + Section 6 (Locked Primary CTA Role Assignment)
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  font-size: 16px; font-weight: 600; letter-spacing: 0.01em;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard);
  text-decoration: none;
  min-width: 44px;
}
.btn:disabled { cursor: not-allowed; }

.btn-primary {
  background: var(--navy-900); color: var(--cream-white);
}
.btn-primary:hover:not(:disabled) { background: var(--navy-800); }
.btn-primary:active:not(:disabled) { background: var(--navy-950); }
.btn-primary:focus-visible { outline: 3px solid var(--focus-ring-dark); outline-offset: 2px; }
.btn-primary:disabled { background: var(--disabled-bg); color: var(--disabled-text); }

/* The single locked emphasis-CTA role (e.g. Step 3's recommended-classification CTA) */
.btn-primary-accent {
  background: var(--teal-500); color: var(--cream-white);
}
.btn-primary-accent:hover:not(:disabled) { background: var(--teal-600); }
.btn-primary-accent:active:not(:disabled) { background: var(--teal-700); }
.btn-primary-accent:focus-visible { outline: 3px solid var(--focus-ring-dark); outline-offset: 2px; }

.btn-secondary {
  background: transparent; color: var(--navy-900);
  border: 2px solid var(--navy-900);
}
.btn-secondary:hover:not(:disabled) { background: rgba(15,38,71,0.08); }
.btn-secondary:active:not(:disabled) { background: rgba(15,38,71,0.14); }
.btn-secondary:focus-visible { outline: 3px solid var(--focus-ring-light); outline-offset: 2px; }
.btn-secondary:disabled { border-color: var(--disabled-text); color: var(--disabled-text); }

.btn-ghost {
  background: transparent; color: var(--navy-900);
  border: none; min-height: 44px; padding: 12px 16px;
}
.btn-ghost:hover:not(:disabled) { background: rgba(15,38,71,0.06); }
.btn-ghost:active:not(:disabled) { background: rgba(15,38,71,0.10); }
.btn-ghost:focus-visible { outline: 3px solid var(--focus-ring-light); outline-offset: 2px; }

.btn-full { width: 100%; }
@media (max-width: 639px) {
  .btn-full-mobile { width: 100%; }
}

.text-link {
  color: var(--teal-700); font-weight: 600; text-decoration: underline;
  cursor: pointer; background: none; border: none; padding: 0; font-size: inherit;
}
.text-link:hover { color: rgba(8,84,78,0.85); }
.text-link:focus-visible { outline: 3px solid var(--focus-ring-light); outline-offset: 2px; }

.btn-spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--cream-white); border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn-spinner { animation: none; } }

/* ==========================================================================
   Forms — Section 7
   ========================================================================== */

.field { margin-bottom: var(--space-5); }
.field label {
  display: block; font-size: 15px; font-weight: 600; margin-bottom: 8px; color: var(--charcoal);
}
.field .required-mark { color: var(--error); margin-left: 2px; }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-input);
  padding: 12px;
  background: var(--card-bg);
  color: var(--charcoal);
  font-size: 16px;
  font-family: inherit;
  transition: border-color var(--duration-fast) var(--ease-standard);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted-text); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--navy-800); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--navy-900); border-width: 2px;
  outline: 3px solid var(--focus-ring-light); outline-offset: 2px;
}
.field input:disabled, .field select:disabled {
  background: var(--disabled-bg); border-color: var(--disabled-text); color: var(--disabled-text);
  cursor: not-allowed;
}
.field .helper-text { font-size: 13px; color: var(--muted-text); margin-top: 6px; }
.field.has-error input, .field.has-error select {
  border: 2px solid var(--error);
}
.field.has-error input:focus, .field.has-error select:focus {
  outline: 3px solid var(--focus-ring-error);
}
.field .error-text {
  font-size: 13px; color: var(--error); margin-top: 6px;
  display: flex; align-items: center; gap: 6px;
}

.error-summary {
  background: var(--error-tint); border: 1.5px solid var(--error);
  border-radius: var(--radius-card); padding: var(--space-4);
  margin-bottom: var(--space-5);
}
.error-summary h2 { font-size: 16px; color: var(--error); margin: 0 0 8px; }
.error-summary ul { list-style: none; margin: 0; padding: 0; }
.error-summary li + li { margin-top: 4px; }
.error-summary a { color: var(--error); font-weight: 600; text-decoration: underline; }

/* Checkbox */
.checkbox-row, .radio-row {
  display: flex; align-items: flex-start; gap: var(--space-3);
  min-height: 44px; padding: var(--space-2) 0; cursor: pointer;
}
.checkbox-row input, .radio-row input {
  appearance: none; -webkit-appearance: none;
  width: 24px; height: 24px; flex-shrink: 0;
  border: 2px solid var(--border-strong); background: var(--card-bg);
  cursor: pointer; position: relative; margin-top: 2px;
}
.checkbox-row input { border-radius: 4px; }
.checkbox-row input:checked {
  background: var(--navy-900); border-color: var(--navy-900);
}
.checkbox-row input:checked::after {
  content: ''; position: absolute; left: 6px; top: 2px;
  width: 6px; height: 11px; border: solid var(--cream-white);
  border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.radio-row input { border-radius: 50%; }
.radio-row input:checked {
  border-color: var(--navy-900);
}
.radio-row input:checked::after {
  content: ''; position: absolute; left: 4px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--navy-900);
}
.checkbox-row input:focus-visible, .radio-row input:focus-visible {
  outline: 3px solid var(--focus-ring-light); outline-offset: 2px;
}
.checkbox-row .row-label, .radio-row .row-label { flex: 1; }
.row-price { color: var(--muted-text); font-weight: 600; }

/* Upload area — Section 7 */
.upload-area {
  min-height: 160px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-upload);
  background: var(--card-bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: var(--space-2); padding: var(--space-5);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard);
}
@media (min-width: 1024px) { .upload-area { min-height: 200px; } }
.upload-area:hover, .upload-area.drag-over {
  border: 2px solid var(--teal-500); background: rgba(14,124,116,0.08);
}
.upload-area:focus-visible {
  outline: 3px solid var(--focus-ring-light); outline-offset: 2px;
}
.upload-area .upload-icon { width: 32px; height: 32px; color: var(--navy-900); }
.upload-area.filled { border-style: solid; }

.photo-thumb-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-3); }
.photo-thumb {
  width: 96px; height: 96px; border-radius: var(--radius-thumb);
  border: 1px solid var(--border-strong); position: relative; overflow: hidden;
  background: var(--divider);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .remove-btn {
  position: absolute; top: 4px; right: 4px; width: 32px; height: 32px;
  border-radius: 50%; background: var(--card-bg); border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  padding: 8px;
}
.photo-thumb .remove-btn:hover { background: rgba(162,59,46,0.10); }
.photo-thumb .remove-btn:focus-visible { outline: 3px solid var(--focus-ring-error); outline-offset: 2px; }
.slot-label { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.slot-required { font-size: 13px; color: var(--muted-text); }
.slot-complete { color: var(--success); font-size: 13px; font-weight: 600; }

/* Choice cards — Issue Selector / Quick Repair Check */
.choice-card {
  min-height: 88px;
  padding: var(--space-5);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-card);
  background: var(--card-bg);
  box-shadow: var(--shadow-informational);
  cursor: pointer; position: relative;
  display: flex; align-items: center; gap: var(--space-4);
  transition: border-color var(--duration-standard) var(--ease-standard),
              background-color var(--duration-standard) var(--ease-standard),
              box-shadow var(--duration-standard) var(--ease-standard);
  text-align: left; width: 100%; font-family: inherit;
}
.choice-card:hover { border-color: var(--navy-800); background: rgba(15,38,71,0.04); box-shadow: var(--shadow-clickable-hover); }
.choice-card:focus-visible { outline: 3px solid var(--focus-ring-light); outline-offset: 2px; }
.choice-card.selected {
  border-color: var(--teal-500); background: rgba(14,124,116,0.08);
}
.choice-card .check-badge {
  position: absolute; top: -10px; right: -10px; width: 28px; height: 28px;
  border-radius: 50%; background: var(--teal-500); color: var(--cream-white);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.choice-card:disabled { background: var(--disabled-bg); border-color: var(--disabled-text); color: var(--disabled-text); cursor: not-allowed; }

/* ==========================================================================
   Cards — Section 8
   ========================================================================== */
.card {
  border-radius: var(--radius-card);
  padding: var(--space-5);
  background: var(--card-bg);
  box-shadow: var(--shadow-informational);
  border: var(--card-hairline);
}
.card-trust, .card-review, .card-team { border: none; }
.card-team img { aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius-card) var(--radius-card) 0 0; }
.family-story { display: grid; gap: var(--space-6); align-items: center; }
.family-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 42%; }
@media (min-width: 768px) {
  .family-story { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
}

.card-status {
  border-left: 4px solid var(--navy-900);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  background: var(--card-bg);
  box-shadow: var(--shadow-informational);
}
.card-status.delivered { border-left-color: var(--success); }

.faq-item {
  border-radius: var(--radius-card);
  background: var(--card-bg);
  box-shadow: var(--shadow-informational);
  margin-bottom: var(--space-4);
  overflow: hidden;
}
.faq-item:hover { box-shadow: var(--shadow-faq-hover); }
.faq-question {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: var(--space-5); display: flex; justify-content: space-between; align-items: center;
  gap: var(--space-4); font-family: inherit; font-weight: 600; font-size: 16px; color: var(--navy-900);
}
.faq-question:focus-visible { outline: 3px solid var(--focus-ring-light); outline-offset: 2px; }
.faq-question .chevron { flex-shrink: 0; transition: transform var(--duration-standard) var(--ease-standard); width: 20px; height: 20px; }
.faq-item[data-open="true"] .chevron { transform: rotate(180deg); }
.faq-answer { padding: 0 var(--space-5) var(--space-5); border-top: 1px solid var(--divider); margin-top: 0; padding-top: var(--space-4); }

/* ==========================================================================
   Trust badges / icon rows
   ========================================================================== */
.trust-row { display: flex; flex-wrap: wrap; gap: var(--space-5); }
.trust-item { display: flex; align-items: center; gap: var(--space-2); }
.trust-item svg { width: 24px; height: 24px; color: var(--teal-500); flex-shrink: 0; }
.card-trust svg { color: var(--teal-500); }

.icon-inline { width: 20px; height: 20px; flex-shrink: 0; }
.icon-16 { width: 16px; height: 16px; }
.icon-24 { width: 24px; height: 24px; }
.icon-32 { width: 32px; height: 32px; }

/* Progress indicator — Start My Repair */
.step-progress { display: flex; align-items: center; gap: 6px; }
.step-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--divider);
}
.step-dot.done, .step-dot.current { background: var(--navy-900); }
.step-progress-text { font-size: 13px; color: var(--muted-text); font-weight: 600; }

/* Placeholder image block — polished neutral panel, not a raw dev marker */
.img-placeholder {
  background: linear-gradient(135deg, var(--band-bg), var(--divider));
  border-radius: var(--radius-card);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-text); text-align: center; padding: var(--space-5);
  min-height: 180px; position: relative;
}
.img-placeholder .ph-icon { width: 28px; height: 28px; margin-bottom: 10px; color: var(--navy-900); opacity: 0.55; }
.img-placeholder .ph-caption { font-size: 13px; font-weight: 600; color: var(--muted-text); }
.img-placeholder-content { display: flex; flex-direction: column; align-items: center; }

.site-photo {
  width: 100%; height: 100%; object-fit: cover; display: block;
  border-radius: var(--radius-card);
}
.hero-photo { min-height: 320px; max-height: 520px; object-position: center top; }
.lab-photo { aspect-ratio: 4 / 3; object-fit: cover; }
.repair-results-grid { display: grid; gap: var(--space-6); }
@media (min-width: 768px) { .repair-results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.repair-result-card {
  overflow: hidden; background: #fff; border: 1px solid var(--divider);
  border-radius: var(--radius-card); box-shadow: var(--shadow-informational);
}
.repair-result-images { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--divider); }
.repair-result-image { position: relative; background: var(--band-bg); }
.repair-result-image img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.repair-result-label {
  position: absolute; left: 10px; bottom: 10px; padding: 4px 9px;
  border-radius: 999px; background: rgba(13, 35, 68, 0.88); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: 0.03em;
}
.repair-result-copy { padding: var(--space-4); }
.prototype-track-note { background:#eef4ff; border:1px solid #c4d5f0; border-radius:8px; padding:12px 14px; margin-bottom:22px; font-size:14px; }
.tracking-result { margin-top:32px; }
.tracking-status-card { border:1px solid var(--divider); border-radius:var(--radius-card); background:var(--card-bg); padding:var(--space-5); box-shadow:var(--shadow-informational); }
.tracking-status-card h2 { margin:4px 0 8px; font-size:28px; }
.tracking-order-number { color:var(--muted-text); font-size:13px; font-weight:700; margin:0; }
.tracking-timeline { list-style:none; padding:8px 0 0; margin:22px 0 0; display:grid; gap:0; }
.tracking-timeline li { display:grid; grid-template-columns:24px 1fr; gap:11px; min-height:54px; position:relative; color:var(--muted-text); font-size:14px; }
.tracking-timeline li:before { content:""; width:12px; height:12px; border-radius:50%; border:2px solid #9daba9; background:var(--card-bg); margin-top:3px; z-index:1; }
.tracking-timeline li:after { content:""; position:absolute; left:6px; top:17px; bottom:0; width:2px; background:#cbd4d2; }
.tracking-timeline li:last-child:after { display:none; }
.tracking-timeline li.complete { color:var(--navy-900); font-weight:600; }
.tracking-timeline li.complete:before { border-color:var(--teal-700); background:var(--teal-700); }
.tracking-error { border:1px solid #c68181; background:#fff2f2; border-radius:8px; padding:14px; color:#6f2020; }
.repair-result-copy h3 { margin-bottom: 4px; }

/* Discreet developer note — visually quiet, never a dominant visual element */
.dev-note {
  font-size: 12px; color: var(--muted-text); opacity: 0.8;
}

/* Banner (info / warning / error) */
.banner { border-radius: var(--radius-card); padding: var(--space-4) var(--space-5); display: flex; gap: var(--space-3); align-items: flex-start; }
.banner-info { background: var(--information-tint); color: var(--information); }
.banner-warning { background: var(--warning-tint); color: var(--warning); }
.banner-error { background: var(--error-tint); color: var(--error); }
.banner-success { background: var(--success-tint); color: var(--success); }
.banner svg { flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px; }
.banner-body { color: var(--charcoal); font-size: 15px; }
.banner-body strong { color: inherit; }
