/* ==========================================================================
   GEARBOX GIANTS — FAULT FINDER 2.0 STYLES
   Exact Homepage Design System Alignment:
   - Fonts: Barlow Condensed (Display/Headings), Plus Jakarta Sans (Body), JetBrains Mono (Badges)
   - Palette: Black (#07090e), Dark Charcoal (#0d1117, #151c27), Amber (#f59e0b, #fbbf24), Neutral Greys
   - Editorial structure: Large headings, supporting context, lines, clean spacing (no excessive card clutter)
   - Focused container width (720px - 850px), responsive mobile padding
   ========================================================================== */

/* Hero Container Override (Ensures no vertical cutoff under fixed header) */
.fault-finder-hero,
.cinematic-hero-section:has(#fault-finder-app) {
  min-height: 100vh !important;
  min-height: 100svh !important;
  height: auto !important;
  display: block !important;
  padding-top: calc(var(--nav-height, 80px) + 2.5rem) !important;
  padding-bottom: 4rem !important;
  overflow: visible !important;
}

.ff-app-wrapper {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1rem 4rem 1rem;
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  color: #f8fafc;
}

/* --------------------------------------------------------------------------
   PHASE TRACKER (SUBTLE, NO VISUAL CLUTTER)
   -------------------------------------------------------------------------- */
.ff-phase-tracker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ff-phase-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #64748b;
  transition: color 0.2s;
}

.ff-phase-item.active {
  color: #fbbf24;
}

.ff-phase-item.completed {
  color: #10b981;
}

.ff-phase-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  background: rgba(255, 255, 255, 0.05);
}

.ff-phase-item.active .ff-phase-dot {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.ff-phase-item.completed .ff-phase-dot {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.ff-phase-divider {
  color: rgba(255, 255, 255, 0.15);
  font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   FLOW CONTAINER & HEADINGS (EDITORIAL HOMEPAGE STYLE)
   -------------------------------------------------------------------------- */
.ff-flow-box {
  background: transparent;
  padding: 0;
}

.ff-heading-group {
  margin-bottom: 2rem;
}

.ff-heading-group.text-center {
  text-align: center;
}

.ff-step-label {
  display: block;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #f59e0b;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.ff-display-heading {
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-size: 2.4rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
  margin: 0 0 0.6rem 0;
  line-height: 1.1;
}

@media (max-width: 640px) {
  .ff-display-heading {
    font-size: 1.9rem;
  }
}

.ff-supporting-text {
  font-size: 1.05rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   STAGE 1: REGISTRATION INTERACTION (520px-650px TOTAL DESKTOP WIDTH)
   -------------------------------------------------------------------------- */
.ff-reg-interactive-area {
  max-width: 580px;
  margin: 0 auto;
}

.ff-reg-action-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.ff-reg-action-row .uk-reg-box {
  max-width: 100%;
  width: 100%;
  height: 60px;
}

.ff-reg-action-row .uk-reg-input {
  font-size: 1.8rem;
  letter-spacing: 0.15em;
}

.btn-reg-find {
  width: 100%;
  height: 52px;
  font-size: 1.05rem;
}

.ff-alert-box {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-top: 1rem;
  text-align: center;
}

/* PROGRESSIVE VEHICLE REVEAL BOX */
.ff-vehicle-reveal-box {
  background: #0d1117;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  padding: 1.75rem;
  margin-top: 1.75rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.ff-reveal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.ff-reveal-eyebrow {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #64748b;
  text-transform: uppercase;
}

.ff-edit-link {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.ff-edit-link:hover {
  color: #ffffff;
}

.ff-reveal-car-title {
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-size: 1.9rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 0.75rem 0;
}

.ff-reveal-details-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.ff-spec-pill {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  background: #151c27;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #cbd5e1;
}

.ff-spec-pill.highlight {
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.08);
}

.ff-manual-toggle-container {
  text-align: center;
  margin-top: 1.25rem;
}

.ff-subtle-link {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem;
  transition: color 0.2s;
}

.ff-subtle-link:hover {
  color: #fbbf24;
}

.ff-manual-panel {
  display: none;
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.ff-manual-panel.open {
  display: block;
}

.ff-manual-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 540px) {
  .ff-manual-form-grid {
    grid-template-columns: 1fr;
  }
}

.ff-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.ff-input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
}

.ff-field {
  background: #151c27;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.ff-field:focus {
  border-color: #f59e0b;
}

/* --------------------------------------------------------------------------
   STAGE 2 & 3: CLEAN NUMBERED CHOICES (EDITORIAL LIST, NO CARD CLUTTER)
   -------------------------------------------------------------------------- */
.ff-choices-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 2rem;
}

.ff-choice-row {
  display: flex;
  align-items: center;
  width: 100%;
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1.15rem 1.25rem;
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ff-choice-row:hover {
  background: #151c27;
  border-color: #f59e0b;
  transform: translateX(4px);
}

.ff-choice-num {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-weight: 700;
  font-size: 0.9rem;
  color: #f59e0b;
  width: 36px;
  flex-shrink: 0;
}

.ff-choice-text {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
}

.ff-choice-arrow {
  font-size: 1.1rem;
  color: #64748b;
  transition: transform 0.2s, color 0.2s;
  flex-shrink: 0;
}

.ff-choice-row:hover .ff-choice-arrow {
  color: #fbbf24;
  transform: translateX(4px);
}

.ff-flow-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ff-back-link {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.ff-back-link:hover {
  color: #ffffff;
}

.ff-keyboard-hint {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.75rem;
  color: #64748b;
}

/* FREE TEXT */
.ff-freetext-container {
  margin-bottom: 2rem;
}

.ff-textarea-clean {
  width: 100%;
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 1rem;
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  resize: vertical;
  box-sizing: border-box;
}

.ff-textarea-clean:focus {
  border-color: #f59e0b;
}

.ff-action-button-row {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
}

/* --------------------------------------------------------------------------
   STAGE 4: DIAGNOSIS RESULTS (CLEAN SUMMARY FIRST)
   -------------------------------------------------------------------------- */
.ff-results-editorial {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.ff-result-summary-block {
  background: #0d1117;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 2.25rem 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

@media (max-width: 640px) {
  .ff-result-summary-block {
    padding: 1.5rem 1.25rem;
  }
}

.ff-result-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.ff-meta-vrm {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-weight: 800;
  font-size: 1.1rem;
  background: #fbc02d;
  color: #000000;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.ff-meta-car {
  font-size: 0.95rem;
  color: #cbd5e1;
}

.ff-result-main-title {
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-size: 2.4rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
  margin: 0 0 1.75rem 0;
  line-height: 1.1;
}

.ff-result-section {
  margin: 1.25rem 0;
}

.ff-section-tag {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.ff-cause-heading {
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-size: 1.85rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 0.35rem 0;
}

.ff-confidence-row {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

.highlight-green {
  color: #34d399 !important;
}

.highlight {
  color: #fbbf24 !important;
}

.ff-plain-summary {
  font-size: 1rem;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.55;
}

.ff-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 1.5rem 0;
}

.ff-urgency-badge {
  display: inline-block;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  margin-bottom: 0.5rem;
}

.ff-urgency-badge.high, .ff-urgency-badge.stop_driving {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.ff-urgency-desc {
  font-size: 0.95rem;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.5;
}

.ff-result-primary-cta {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.ff-cta-sublinks {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.ff-sublink-whatsapp {
  color: #34d399;
  text-decoration: none;
  font-weight: 600;
}

.ff-sublink-call {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 600;
}

.ff-sublink-divider {
  color: #475569;
}

/* --------------------------------------------------------------------------
   ACCESSIBLE ACCORDIONS (PROGRESSIVELY DISCLOSED DETAIL)
   -------------------------------------------------------------------------- */
.ff-accordions-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ff-accordion-item {
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.ff-accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  padding: 1.1rem 1.25rem;
  text-align: left;
  cursor: pointer;
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
}

.ff-accordion-toggle:hover {
  background: rgba(255, 255, 255, 0.02);
}

.ff-toggle-icon {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 1.2rem;
  color: #f59e0b;
}

.ff-accordion-body {
  padding: 0 1.25rem 1.25rem 1.25rem;
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.55;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.ff-editorial-list {
  margin: 0.75rem 0 0 0;
  padding-left: 1.25rem;
}

.ff-editorial-list li {
  margin-bottom: 0.5rem;
}

/* DIFFERENTIAL CAUSES */
.ff-diff-cause-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ff-diff-cause-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ff-diff-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.ff-diff-header strong {
  color: #ffffff;
}

.ff-diff-match {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.8rem;
  color: #94a3b8;
}

.ff-diff-desc {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0;
}

/* CHECKLIST */
.ff-numbered-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.ff-check-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.ff-step-num {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.8rem;
  font-weight: 700;
  color: #f59e0b;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* TECHNICIAN DOSSIER */
.ff-tech-dossier {
  margin-top: 0.75rem;
}

.ff-tech-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 500px) {
  .ff-tech-grid {
    grid-template-columns: 1fr;
  }
}

.ff-tech-mechanism {
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.ff-tech-mechanism strong {
  color: #ffffff;
  display: block;
  margin-bottom: 0.2rem;
}

.ff-tech-mechanism p {
  margin: 0;
  color: #94a3b8;
}

/* BOTTOM ACTION CARD */
.ff-bottom-action-card {
  background: #0d1117;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  margin-top: 1rem;
}

.ff-bottom-card-title {
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-size: 1.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 0.4rem 0;
}

.ff-bottom-card-sub {
  font-size: 0.95rem;
  color: #cbd5e1;
  max-width: 550px;
  margin: 0 auto 1.5rem auto;
  line-height: 1.5;
}

.ff-restart-row {
  margin-top: 0.5rem;
}

/* --------------------------------------------------------------------------
   LEAD MODAL
   -------------------------------------------------------------------------- */
.ff-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ff-modal-box {
  position: relative;
  background: #0d1117;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  padding: 2.25rem 2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  box-sizing: border-box;
}

.ff-modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ff-modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.ff-modal-vehicle-banner {
  background: #151c27;
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 1.25rem;
}

.ff-modal-vehicle-banner strong {
  color: #fbbf24;
}

.ff-modal-privacy {
  font-size: 0.75rem;
  color: #64748b;
  text-align: center;
  margin: 0.75rem 0 0 0;
}

.ff-success-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(16, 185, 129, 0.2);
  border: 2px solid #10b981;
  color: #10b981;
  font-size: 1.5rem;
  border-radius: 50%;
}

.ff-success-details {
  background: #151c27;
  border-radius: 8px;
  padding: 1rem;
  margin: 1.25rem 0;
  text-align: left;
  font-size: 0.85rem;
  color: #cbd5e1;
}

.ff-success-details div {
  margin-bottom: 0.35rem;
}

/* --------------------------------------------------------------------------
   ANIMATIONS & UTILITIES
   -------------------------------------------------------------------------- */
.animate-fade-in {
  animation: ffFadeIn 0.25s ease-out;
}

@keyframes ffFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.spinner-large {
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(245, 158, 11, 0.2);
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: ffSpin 0.8s linear infinite;
  margin-bottom: 1rem;
}

@keyframes ffSpin {
  to { transform: rotate(360deg); }
}
