/* ─── TOKENS ─────────────────────────────────────────────────────────────── */

:root {
  --black:       #0A0A0A;
  --amber:       #F59E0B;
  --amber-dark:  #D97706;
  --amber-light: #FEF3C7;
  --white:       #FFFFFF;
  --gray-light:  #F5F5F5;
  --gray-mid:    #6B7280;
  --gray-border: #E5E7EB;
}

/* ─── RESET & BASE ───────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--black);
  background: var(--white);
}

img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ─── TYPOGRAPHY ─────────────────────────────────────────────────────────── */

.display {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.07;
  letter-spacing: -0.01em;
}

h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1.15;
}

h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.3;
}

.overline {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 16px;
}

/* ─── LAYOUT ─────────────────────────────────────────────────────────────── */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.text-container {
  max-width: 720px;
}

/* ─── BUTTONS ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 16px;
  border-radius: 6px;
  padding: 14px 28px;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--amber);
  color: var(--black);
}
.btn-primary:hover  { background: var(--amber-dark); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  background: var(--black);
  color: var(--white);
}
.btn-secondary:hover    { background: #1F1F1F; }
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-large { padding: 18px 36px; font-size: 18px; }

/* ─── SITE HEADER ────────────────────────────────────────────────────────── */

.site-header {
  background: var(--black);
  padding: 20px 24px;
  display: flex;
  align-items: center;
}

.wordmark {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--white);
  letter-spacing: -0.01em;
}

/* ─── HERO ───────────────────────────────────────────────────────────────── */

#hero-section {
  background: var(--black);
  color: var(--white);
  padding: 96px 0;
}

.hero-inner {
  max-width: 720px;
}

.hero-sub {
  font-size: 18px;
  color: #D1D5DB;
  margin-top: 20px;
  margin-bottom: 40px;
  line-height: 1.65;
}

/* Search form: city select + input row */
.search-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: #D1D5DB;
  margin-top: 8px;
}

#city-select {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  border: 2px solid var(--white);
  border-radius: 6px;
  background: var(--white);
  color: var(--black);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230A0A0A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#city-select:focus        { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,0.25); }
#city-select option       { background: var(--white); color: var(--black); }

/* Autocomplete input + button */
.autocomplete-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.autocomplete-input-wrap {
  flex: 1;
  min-width: 260px;
  position: relative;
}

.autocomplete-input-wrap input {
  width: 100%;
  height: 100%;
  min-height: 56px;
  padding: 0 16px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  border: 2px solid var(--white);
  border-radius: 6px;
  background: var(--white);
  color: var(--black);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.autocomplete-input-wrap input::placeholder { color: #9CA3AF; }
.autocomplete-input-wrap input:focus        { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,0.25); }
.autocomplete-input-wrap input:disabled     { background: #F9FAFB; border-color: #D1D5DB; color: #9CA3AF; cursor: not-allowed; }

.reassurance {
  font-size: 13px;
  color: #9CA3AF;
}

.input-error {
  font-size: 13px;
  color: #EF4444;
  margin-top: 8px;
}

/* Map confirmation */
#map-container {
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--amber);
}

#map-preview {
  width: 100%;
  height: 220px;
}

.place-confirm-card {
  background: var(--white);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.place-confirm-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.place-confirm-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-confirm-address {
  font-size: 13px;
  color: var(--gray-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-confirm-reset {
  font-size: 13px;
  color: var(--gray-mid);
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
}

.place-confirm-reset:hover { color: var(--black); }

/* Custom search dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  list-style: none;
  z-index: 9999;
  overflow: hidden;
}

.search-dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.1s;
}

.search-dropdown-item:hover { background: var(--gray-light); }

.dropdown-main {
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-sub {
  font-size: 12px;
  color: var(--gray-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── HOW IT WORKS ───────────────────────────────────────────────────────── */

#how-it-works {
  background: var(--gray-light);
  padding: 96px 0;
}

#how-it-works h2 {
  margin-bottom: 48px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
}

.step-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--black);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-card p { color: var(--gray-mid); font-size: 15px; }

/* ─── FAQ ────────────────────────────────────────────────────────────────── */

#faq {
  background: var(--white);
  padding: 96px 0;
}

#faq h2 { margin-bottom: 48px; }

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 720px;
}

.faq-item {
  padding: 24px 0;
  border-bottom: 1px solid var(--gray-border);
}

.faq-item:first-child { border-top: 1px solid var(--gray-border); }

.faq-item h3 { margin-bottom: 8px; font-size: 17px; }
.faq-item p  { color: var(--gray-mid); font-size: 15px; }

/* ─── CTA REPEAT ─────────────────────────────────────────────────────────── */

#cta-repeat {
  background: var(--black);
  color: var(--white);
  padding: 96px 0;
  text-align: center;
}

#cta-repeat h2 { margin-bottom: 32px; }

/* ─── SITE FOOTER ────────────────────────────────────────────────────────── */

.site-footer {
  background: var(--black);
  color: #6B7280;
  border-top: 1px solid #1F2937;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 8px;
}

.site-footer a:hover { color: var(--white); }

/* ─── FULLSCREEN STEPS (loading / score tease / report) ─────────────────── */

.fullscreen-step {
  min-height: 100vh;
  background: var(--white);
}

/* ─── LOADING ────────────────────────────────────────────────────────────── */

#step-loading {
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
}

#step-loading[hidden] { display: none; }

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #1F2937;
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-message {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: #9CA3AF;
  min-height: 24px;
  text-align: center;
}

/* ─── ASSESSMENT HEADER (score tease + report) ───────────────────────────── */

.assessment-header {
  background: var(--black);
  padding: 20px 24px;
}

/* ─── ASSESSMENT CONTAINER ───────────────────────────────────────────────── */

.assessment-container {
  max-width: 640px;
  padding-top: 48px;
  padding-bottom: 80px;
}

/* ─── SCORE CARD ─────────────────────────────────────────────────────────── */

.score-card {
  text-align: center;
  margin-bottom: 40px;
}

.score-card .clinic-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--black);
  margin-bottom: 28px;
}

/* ─── GAUGE ──────────────────────────────────────────────────────────────── */

.gauge-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 24px;
}

.gauge-svg {
  width: 180px;
  height: 180px;
  overflow: visible;
}

.gauge-track {
  fill: none;
  stroke: var(--gray-border);
  stroke-width: 10;
}

.gauge-fill {
  fill: none;
  stroke: var(--amber);
  stroke-width: 10;
  stroke-dasharray: 339.3;
  stroke-dashoffset: 339.3;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.05s linear, stroke 0.3s ease;
}

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}

.gauge-score-number {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 42px;
  line-height: 1;
  color: var(--black);
}

.gauge-score-label {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--gray-mid);
}

.score-headline {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 2.5vw, 24px);
  color: var(--black);
  line-height: 1.3;
}

/* ─── BLURRED METRICS (score tease) ─────────────────────────────────────── */

.metrics-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  position: relative;
}

.metrics-blur-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 8px;
  z-index: 1;
  pointer-events: none;
}

.metric-preview-card {
  background: var(--gray-light);
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-preview-label {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--gray-mid);
  flex: 1;
}

.metric-preview-bar {
  width: 100px;
  height: 6px;
  background: var(--gray-border);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.metric-preview-bar-fill {
  height: 100%;
  background: var(--gray-mid);
  border-radius: 3px;
}

/* ─── PDF LOCKED BUTTON ──────────────────────────────────────────────────── */

.pdf-locked {
  margin-bottom: 32px;
  text-align: center;
}

/* ─── PHONE GATE ─────────────────────────────────────────────────────────── */

.phone-gate {
  background: var(--gray-light);
  border: 1px solid var(--gray-border);
  border-radius: 12px;
  padding: 32px;
}

.phone-gate-intro {
  font-size: 16px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 16px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.phone-gate-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.phone-gate-row input {
  flex: 1;
  min-width: 180px;
  min-height: 52px;
  padding: 0 16px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  border: 1.5px solid var(--gray-border);
  border-radius: 6px;
  background: var(--white);
  color: var(--black);
  outline: none;
  transition: border-color 0.15s;
}

.phone-gate-row input:focus        { border-color: var(--amber); }
.phone-gate-row input.input-invalid { border-color: #EF4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }

.phone-gate-disclaimer {
  font-size: 13px;
  color: var(--gray-mid);
}

.phone-gate-error {
  font-size: 13px;
  color: #EF4444;
  margin-top: 8px;
}

/* ─── FULL METRIC CARDS ──────────────────────────────────────────────────── */

.metrics-full {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

.metric-card {
  border-radius: 10px;
  padding: 20px;
  border: 1.5px solid var(--gray-border);
  background: var(--white);
}

.metric-card--good       { border-color: #BBF7D0; }
.metric-card--needs_work { border-color: #FED7AA; }
.metric-card--missing    { border-color: #FECACA; }

.metric-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.metric-card-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--black);
}

.metric-status {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.metric-status--good       { background: #DCFCE7; color: #166534; }
.metric-status--needs_work { background: #FEF3C7; color: #92400E; }
.metric-status--missing    { background: #FEE2E2; color: #991B1B; }

.metric-card-value {
  font-size: 13px;
  color: var(--gray-mid);
  margin-bottom: 10px;
}

.metric-progress-bar {
  height: 6px;
  background: var(--gray-border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 14px;
}

.metric-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.metric-card-copy {
  font-size: 14px;
  line-height: 1.6;
  color: var(--black);
}

.metric-card-rec {
  font-size: 13px;
  line-height: 1.6;
  color: var(--gray-mid);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-border);
}

/* ─── REPORT ACTIONS ─────────────────────────────────────────────────────── */

.report-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.report-actions .btn {
  width: 100%;
  justify-content: center;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  #hero-section { padding: 56px 0; }
  #how-it-works { padding: 56px 0; }
  #faq          { padding: 56px 0; }
  #cta-repeat   { padding: 56px 0; }

  .autocomplete-row { flex-direction: column; }
  .autocomplete-row .btn { width: 100%; }

  .phone-gate { padding: 24px 20px; }
  .phone-gate-row { flex-direction: column; }
  .phone-gate-row .btn { width: 100%; }

  .assessment-container { padding-top: 32px; padding-bottom: 56px; }
  .gauge-wrapper { width: 160px; height: 160px; }
  .gauge-svg     { width: 160px; height: 160px; }
  .gauge-score-number { font-size: 36px; }
}

@media (min-width: 641px) {
  .report-actions {
    flex-direction: row;
    align-items: center;
  }
  .report-actions .btn { width: auto; flex: 1; }
}
