/* ==========================================================================
   AI Hair Transplant Planning — page styles for the Estecenter PHP site.

   Rewritten from scratch to match the Estecenter site theme. It builds on the
   design tokens already shipped by css/theme.css (--color-*, --alt-color-*)
   and css/secilen.css (--c-*, --fs-*, --fw-*, --radius*, --gap-*, --shadow-*,
   .wrap, .sec, .tc, .btn, .btn-bright, .btn-lg, .btn-pill, .sec-lbl).

   Palette: teal primary (#075f86 / #127ccf, from --color-*) with the brand
   gold/taupe accent (--alt-color-*, base #9d884f) — the same accent used by
   the CTA form submit and the header "360 Tour" button, so this page now reads
   as part of the site rather than a mint-green outlier.

   The class / data-attribute contract used by js/hair-analysis.js and the page
   markup is preserved verbatim; only the visual styling changed. Loaded last,
   so it wins where it overlaps.
   ========================================================================== */

:root {
  /* Brand accent (gold/taupe) surfaced as local aliases for this page. */
  --ha-accent: var(--alt-color-8);        /* #9d884f */
  --ha-accent-dark: var(--alt-color-6);   /* #756437 */
  --ha-accent-soft: var(--alt-color-20-opacity);
  --ha-accent-tint: var(--alt-color-10-opacity);

  /* Deep brand gradient used by the summary total tile and the login backdrop. */
  --g-primary: linear-gradient(135deg, #075f86 0%, #07505a 100%);
  /* Warm off-white surface used across the site (footer, reviews, promo). */
  --ha-surface-warm: #f6efe4;
}

/* `hidden` is only a user-agent `display: none` and loses to any author rule
   that sets `display` — which most components here do. Restoring its meaning
   once keeps the report card, preview veil and per-card buttons hideable. */
[hidden] {
  display: none !important;
}

/* ===== HELPERS NOT CARRIED BY secilen.css ===== */
.sec--light {
  background: #e8f8fc;
}
/* HOW-IT-WORKS section shares the same tint as the upload section */
.section.ha-how {
  background-color: #e8f8fc;
}
html {
  scroll-behavior: smooth;
}
#upload,
#haProgress,
#haReport {
  scroll-margin-top: 96px;
}
.sec--white {
  background: var(--c-white);
}
.sec > .wrap > h2,
.ha-report__intro h2 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-black);
  line-height: 1.15;
  color: var(--c-dark);
  margin: 0 0 12px;
}
.sec-sub {
  color: var(--c-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 64ch;
  margin: 0 auto 8px;
}
.sec-sub.tc {
  text-align: center;
}

.btn-sm {
  padding: 8px 16px;
  font-size: var(--fs-sm);
  border-radius: var(--radius);
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--c-primary);
  color: var(--c-primary);
}
.btn-outline:hover {
  background: var(--c-primary);
  color: #fff;
  transform: translateY(-1px);
}

/* ===== REUSED HERO FORM (report gate + admin login) ===== */
.hero__form {
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.hero__form-title {
  font-size: var(--fs-h5);
  font-weight: var(--fw-bold);
  margin-bottom: 4px;
}
.hero__form-sub {
  font-size: var(--fs-sm);
  margin: 0 0 18px;
}
.f-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.f-field label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.4px;
}
.f-field input,
.f-field select,
.f-field textarea {
  font-family: inherit;
  font-size: var(--fs-sm);
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-white);
  color: var(--c-dark-alt);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.f-field input:focus,
.f-field select:focus,
.f-field textarea:focus {
  border-color: var(--c-primary-lt);
}
.f-submit {
  width: 100%;
  padding: 14px 20px;
  border: 1px solid var(--ha-accent);
  border-radius: var(--radius-pill);
  background: var(--ha-accent);
  color: #fff;
  font-family: inherit;
  font-weight: var(--fw-bold);
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s, border-color 0.2s;
}
.f-submit:hover {
  background: var(--ha-accent-dark);
  border-color: var(--ha-accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--alt-color-40-opacity);
}
.f-submit[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.hero-phone-row {
  display: flex;
  gap: 8px;
}
.hero-cc {
  flex: 0 0 auto;
  width: auto;
  font-family: inherit;
  font-size: var(--fs-sm);
  padding: 0.7rem 0.6rem;
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-white);
  color: var(--c-dark-alt);
  cursor: pointer;
}
.hero-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--fs-xs);
  line-height: 1.5;
  margin-bottom: 14px;
}
.hero-consent a {
  color: var(--c-primary);
}

/* ==========================================================================
   HERO
   The site nav is position:absolute and overlaps the top of the page, so the
   first section carries a top offset the same way the other page heroes do.
   ========================================================================== */
.ha-hero {
  position: relative;
  color: #fff;
  /* Banner-style hero, same treatment as the Services page hero (full-bleed
     photo behind a teal brand wash), but sized to the wide hair-analysis
     banner image so it stays short rather than full-viewport. */
  padding: 138px 0 46px;
  text-align: center;
  background-image:
    linear-gradient(115deg, rgba(7, 80, 90, 0.92) 0%, rgba(7, 95, 134, 0.74) 52%, rgba(18, 124, 207, 0.58) 100%),
    url("../images/hair-analysis.webp");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}
.ha-hero .wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ha-hero h1 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-black);
  line-height: 1.1;
  margin: 0 auto 14px;
  max-width: 22ch;
  color: #fff;
  text-shadow: 0 2px 20px rgba(7, 51, 36, 0.35);
}
.ha-hero h1 em {
  font-style: normal;
  color: var(--alt-color-11);
}
.ha-hero p {
  color: var(--c-text-on-dark);
  font-weight: var(--fw-light);
  max-width: 60ch;
  margin: 0 auto;
}
.ha-hero__list {
  margin-top: 28px;
}
.ha-hero__steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.ha-hero__step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.88);
  font-size: var(--fs-sm);
}
.ha-hero__step b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: rgba(157, 136, 79, 0.28);
  color: var(--alt-color-12);
  font-size: var(--fs-xs);
  font-weight: var(--fw-black);
  flex-shrink: 0;
}
.ha-hero__bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}
.ha-logout {
  padding: 5px 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-pill);
  background: rgba(7, 80, 90, 0.3);
  color: #fff;
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.ha-logout:hover {
  background: rgba(7, 80, 90, 0.5);
  border-color: #fff;
}

/* ===== SHARED CARD GRID ===== */
.ha-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap-md);
}

/* ===== UPLOAD CARDS ===== */
/* Same box treatment as the Contact page `.content-11-link-block` cards:
   a thin gold/taupe border, 5px radius, no drop shadow, and a soft gold
   tint on hover. */
.ha-card {
  display: flex;
  flex-direction: column;
  background: var(--c-white);
  border: 1px solid var(--alt-color-40-opacity);
  border-radius: 5px;
  padding: 24px;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}
.ha-card:hover {
  border-color: var(--alt-color-9);
  background-color: var(--alt-color-10-opacity);
}
.ha-card[data-state="accepted"] {
  border-color: rgba(5, 150, 105, 0.45);
}
.ha-card[data-state="accepted-warning"] {
  border-color: rgba(217, 119, 6, 0.45);
}
.ha-card[data-state="rejected"] {
  border-color: rgba(220, 38, 38, 0.45);
}
.ha-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
/* Mirrors `.content-11-icon.is-green`: a gold-bordered, gold-tinted rounded
   square rather than a flat pill. */
.ha-card__step {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid var(--alt-color-9);
  border-radius: 5px;
  background: var(--alt-color-10-opacity);
  color: var(--ha-accent-dark);
  font-size: var(--fs-h5);
  font-weight: var(--fw-black);
}
.ha-card__head h3 {
  font-size: var(--fs-h5);
  font-weight: var(--fw-bold);
  margin: 0;
}

.ha-drop {
  position: relative;
  border: 2px dashed var(--c-slate-lt);
  border-radius: var(--radius);
  background: var(--c-off-white);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.ha-card[data-state="accepted"] .ha-drop {
  border-style: solid;
  border-color: rgba(5, 150, 105, 0.35);
}
.ha-card[data-state="accepted-warning"] .ha-drop {
  border-style: solid;
  border-color: rgba(217, 119, 6, 0.35);
}
.ha-card[data-state="rejected"] .ha-drop {
  border-style: solid;
  border-color: rgba(220, 38, 38, 0.35);
}
.ha-drop.is-dragover {
  border-color: var(--c-primary-lt);
  background: var(--color-14);
}
.ha-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.ha-drop__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-align: center;
  padding: 16px;
}
.ha-file:focus-visible + .ha-drop__label {
  outline: 3px solid var(--c-primary-lt);
  outline-offset: -3px;
}
.ha-drop__label svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--c-primary-lt);
  stroke-width: 1.6;
}
/* Label typography echoes the site .paragraph (weight 500, 1.5 line-height). */
.ha-drop__label strong {
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--c-dark);
}
/* Line-art head diagrams (JPG on white). `multiply` drops the white ground so
   only the strokes show over the light drop zone.
   Sized as a share of the drop box (not fixed px) with a hard cap, so the icon
   always scales down with the card and can never overflow its box. */
.ha-drop__label .ha-drop__icon {
  width: 34%;
  min-width: 60px;
  max-width: 108px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  opacity: 0.9;
  margin-bottom: 4px;
  mix-blend-mode: multiply;
}
.ha-drop__label span {
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--c-muted);
}

/* Head-position diagrams. Two class selectors so they win over the generic
   `.ha-drop__label svg` sizing and its inherited `fill: none`. */
.ha-drop__label .ha-vec {
  width: 132px;
  height: 116px;
  stroke: var(--c-primary);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ha-drop__label .ha-vec__area {
  fill: var(--color-30-opacity);
  stroke: none;
}
.ha-drop__label .ha-vec__dot {
  fill: var(--c-primary);
  stroke: none;
}
.ha-drop__label .ha-vec__zone {
  fill: var(--color-20-opacity);
  stroke: var(--c-primary-lt);
  stroke-width: 1.1;
}
.ha-preview {
  position: absolute;
  inset: 0;
  background: #07505a;
}
.ha-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ha-preview__veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  background: rgba(7, 80, 90, 0.62);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

/* Status pill sits over the photo, so it keeps semantic colours but is dressed
   in the site pill language: full radius, black weight, a soft shadow, a light
   backdrop blur for legibility and a small leading status dot. */
.ha-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 9px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: var(--fw-black);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(7, 80, 90, 0.82);
  color: #fff;
  box-shadow: 0 2px 8px rgba(7, 51, 36, 0.25);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.ha-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}
.ha-badge--ok {
  background: rgba(5, 150, 105, 0.92);
}
.ha-badge--warn {
  background: rgba(217, 119, 6, 0.92);
}
.ha-badge--bad {
  background: rgba(220, 38, 38, 0.92);
}

.ha-status {
  min-height: 20px;
  margin-top: 12px;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--c-muted);
}
.ha-status strong {
  display: block;
  color: var(--c-dark);
  font-weight: var(--fw-bold);
}
.ha-status--ok strong {
  color: #047857;
}
.ha-status--warn strong {
  color: #b45309;
}
.ha-status--bad strong {
  color: #b91c1c;
}
.ha-status ul {
  margin: 6px 0 0;
  padding-left: 18px;
}
.ha-status li {
  font-size: var(--fs-xs);
}

.ha-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
/* Compact ghost chips that echo the card's gold-bordered language: transparent
   with a thin taupe border and teal label, filling with a soft gold tint on
   hover. "Remove" carries a muted danger tone. Overrides the generic
   .btn-outline / .btn-sm the markup ships with. */
.ha-card__actions .btn {
  flex: 1 1 auto;
  padding: 8px 14px;
  border: 1px solid var(--alt-color-40-opacity);
  border-radius: 5px;
  background: transparent;
  color: var(--c-primary);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.3px;
  transition: background-color 0.18s ease, border-color 0.18s ease,
    color 0.18s ease;
}
.ha-card__actions .btn:hover {
  background: var(--alt-color-10-opacity);
  border-color: var(--alt-color-9);
  color: var(--ha-accent-dark);
  transform: none;
  box-shadow: none;
}
.ha-card__actions [data-action="remove"] {
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.32);
}
.ha-card__actions [data-action="remove"]:hover {
  background: #fef2f2;
  border-color: #dc2626;
  color: #b91c1c;
}

/* ===== SPINNER ===== */
.ha-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: ha-spin 0.8s linear infinite;
}
.ha-spinner--dark {
  border-color: rgba(7, 95, 134, 0.18);
  border-top-color: var(--c-primary-lt);
}
@keyframes ha-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== DOCTOR PLANNING (admin) ===== */
.ha-doctor {
  margin-top: var(--gap-md);
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.ha-doctor__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  font-weight: var(--fw-bold);
}
.ha-doctor__head small {
  display: block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
  color: var(--c-muted);
  margin-top: 2px;
}
.ha-doctor__body {
  padding: 0 20px 20px;
  border-top: 1px solid var(--c-border);
}
.ha-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  cursor: pointer;
  padding: 12px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-off-white);
}
.ha-toggle input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--c-primary-lt);
}
.ha-toggle--inline {
  margin-top: 12px;
  font-weight: var(--fw-semibold);
  background: var(--c-white);
}
.ha-fieldset {
  border: 0;
  padding: 0;
  margin: 24px 0 0;
}
.ha-fieldset legend {
  font-size: var(--fs-xs);
  font-weight: var(--fw-black);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ha-accent-dark);
  padding: 0;
  margin-bottom: 12px;
}
.ha-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--gap-sm);
}
.ha-fields--notes {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.ha-fields label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--c-muted);
  margin-bottom: 6px;
  display: block;
}
.ha-fields input,
.ha-fields select,
.ha-fields textarea {
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--c-dark-alt);
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  outline: none;
  background: var(--c-white);
}
.ha-fields textarea {
  min-height: 76px;
  resize: vertical;
}
.ha-fields textarea:focus,
.ha-fields input:focus,
.ha-fields select:focus {
  border-color: var(--c-primary-lt);
}

/* ===== ACTION BAR ===== */
.ha-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: var(--gap-md);
  text-align: center;
}
.ha-actions .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.ha-hint {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  margin: 0;
}
.ha-alert {
  margin-top: var(--gap-sm);
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #fef2f2;
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #991b1b;
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.ha-alert--dark {
  margin-top: 0;
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

/* ===== PROGRESS (vertical stepper) ===== */
/* Outer frame matches the site card language (`.content-11` / `.ha-card`):
   thin gold/taupe border and the same 5px radius, kept clean of heavy shadow. */
.ha-progress {
  margin-top: var(--gap-md);
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
  background: var(--c-white);
  border: 1px solid var(--alt-color-40-opacity);
  border-radius: 5px;
  padding: 22px 26px 20px;
  box-shadow: var(--shadow-sm);
  counter-reset: ha-step;
}
.ha-progress__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--c-border);
}
.ha-progress__loader {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 3px solid var(--color-20-opacity);
  border-top-color: var(--c-primary-lt);
  animation: ha-spin 0.9s linear infinite;
}
@keyframes ha-spin {
  to {
    transform: rotate(360deg);
  }
}
.ha-progress__intro {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ha-progress__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: var(--fw-bold);
  color: var(--c-dark);
}
.ha-progress__sub {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--c-muted);
}
.ha-progress__track {
  list-style: none;
  margin: 0;
  padding: 8px 0 0;
}
.ha-progress__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  counter-increment: ha-step;
  font-size: var(--fs-sm);
  color: var(--c-muted);
  transition: color 0.25s ease;
}
/* Vertical connector between the circular nodes. */
.ha-progress__row::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 32px;
  bottom: -10px;
  width: 2px;
  background: var(--c-border);
  transition: background 0.25s ease;
}
.ha-progress__row:last-child::before {
  display: none;
}
.ha-progress__node {
  position: relative;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--alt-color-40-opacity);
  background: var(--c-white);
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: var(--fw-bold);
  color: var(--c-muted);
  transition: all 0.25s ease;
}
.ha-progress__node::before {
  content: counter(ha-step);
}
.ha-progress__label {
  line-height: 1.4;
}
/* active */
.ha-progress__row[data-state="active"] {
  color: var(--c-dark);
  font-weight: var(--fw-semibold);
}
.ha-progress__row[data-state="active"] .ha-progress__node {
  border-color: var(--c-primary-lt);
  color: var(--c-primary-lt);
  animation: ha-node-pulse 1.3s ease-in-out infinite;
}
@keyframes ha-node-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px var(--color-20-opacity);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(16, 152, 211, 0);
  }
}
/* done */
.ha-progress__row[data-state="done"] {
  color: var(--c-dark);
}
.ha-progress__row[data-state="done"] .ha-progress__node {
  border-color: var(--c-primary);
  background: var(--c-primary);
  color: #fff;
}
.ha-progress__row[data-state="done"] .ha-progress__node::before {
  content: "";
  width: 11px;
  height: 6px;
  border-left: 2.6px solid #fff;
  border-bottom: 2.6px solid #fff;
  transform: translateY(-1px) rotate(-45deg);
}
.ha-progress__row[data-state="done"]::before {
  background: var(--c-primary);
}
/* failed */
.ha-progress__row[data-state="failed"] {
  color: #b91c1c;
}
.ha-progress__row[data-state="failed"] .ha-progress__node {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}
.ha-progress__row[data-state="failed"] .ha-progress__node::before {
  content: "!";
}

/* ===== RESULTS ===== */
.ha-result {
  display: flex;
  flex-direction: column;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.ha-result__head {
  padding: 18px 20px 12px;
}
.ha-result__head h3 {
  font-size: var(--fs-h5);
  font-weight: var(--fw-bold);
  margin: 0 0 4px;
}
.ha-result__head p {
  font-size: var(--fs-xs);
  color: var(--c-muted);
  margin: 0;
}
.ha-result__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--c-near-white);
  display: grid;
  place-items: center;
}
.ha-result__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #07505a;
}
.ha-result__pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
  color: var(--c-muted);
  padding: 20px;
  text-align: center;
}
.ha-result__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px 20px 18px;
  margin-top: auto;
}
.ha-result__status {
  flex: 1 1 100%;
  font-size: var(--fs-sm);
  color: var(--c-muted);
}
.ha-result[data-state="failed"] .ha-result__status {
  color: #b91c1c;
}
.ha-result[data-state="done"] .ha-result__status {
  color: #047857;
}

/* ===== TREATMENT SUMMARY ===== */
.ha-summary {
  margin-top: var(--gap-md);
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}
.ha-summary__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.ha-summary__head h3 {
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
  margin: 0;
}
.ha-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--ha-accent-tint);
  color: var(--ha-accent-dark);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.ha-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--c-border);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ha-stat {
  background: var(--c-white);
  padding: 16px;
}
.ha-stat__lbl {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: 6px;
}
.ha-stat__val {
  font-size: var(--fs-h5);
  font-weight: var(--fw-black);
  color: var(--c-dark);
  line-height: 1.2;
}
.ha-stat--total {
  background: var(--g-primary);
}
.ha-stat--total .ha-stat__lbl {
  color: var(--alt-color-12);
}
.ha-stat--total .ha-stat__val {
  color: #fff;
}
.ha-summary__notes {
  margin-top: 18px;
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--c-muted);
}
.ha-summary__notes ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.ha-final-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: var(--gap-md);
}
.ha-lang {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-dark);
}
.ha-lang select {
  font-family: inherit;
  font-size: var(--fs-sm);
  padding: 0.55rem 0.75rem;
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-white);
  color: var(--c-dark-alt);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}
.ha-lang select:focus {
  border-color: var(--c-primary-lt);
}
.ha-final-actions .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.ha-disclaimer {
  margin: var(--gap-md) auto 0;
  max-width: 70ch;
  padding: 16px 18px;
  border-left: 3px solid var(--ha-accent);
  background: var(--alt-color-05-opacity);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--c-muted);
}
.ha-disclaimer strong {
  color: var(--c-dark);
}

/* ===== STEP 3: REPORT DELIVERY (patient page) ===== */
/* Same flat tint as the upload section above it (`.sec--light`), so the
   report reads as a continuation of the page rather than a new band. */
.ha-report {
  background: #e8f8fc;
  color: var(--c-dark);
  padding: var(--section-pad) 0;
}
.ha-report__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: var(--gap-lg);
  align-items: center;
}
.ha-report__intro h2 {
  font-weight: var(--fw-black);
  line-height: 1.15;
  margin: 0 0 14px;
  color: var(--c-dark);
}
.ha-report__intro > p {
  color: var(--c-muted);
  font-weight: var(--fw-regular);
  max-width: 46ch;
  margin: 0 0 26px;
}
.ha-report__list {
  list-style: none;
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
}
.ha-report__list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--c-dark-alt);
}
.ha-report__intro > .ha-report__note {
  margin: 26px 0 0;
  max-width: 52ch;
  font-size: var(--fs-xs);
  line-height: 1.7;
  color: var(--c-muted);
}
.ha-report__list svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  fill: none;
  stroke: var(--ha-accent);
  stroke-width: 2;
}
.ha-report__card {
  width: 100%;
}
.ha-report__card .hero-phone-row .hero-cc {
  width: auto;
  flex: 0 0 auto;
}
/* Report form mirrors the site CTA appointment form (`.cta-1-content.is-form`):
   a translucent glass card over the light section, teal text, translucent
   fields and a solid gold submit button. The field set stays as-is; only the
   visual skin is pulled from the CTA form. */
.ha-report__card.hero__form {
  background-color: var(--ha-surface-warm);
  border: 1px solid rgba(7, 95, 134, 0.16);
  border-radius: 5px;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 35px 35px 70px -30px rgba(45, 39, 25, 0.4);
  padding: 32px 34px 28px;
  color: #075f86;
  transition: box-shadow 0.6s cubic-bezier(0.075, 0.82, 0.165, 1),
    transform 0.6s cubic-bezier(0.075, 0.82, 0.165, 1);
}
.ha-report__card.hero__form:hover {
  transform: translate(-4px, -4px);
  box-shadow: 49px 49px 90px -30px rgba(45, 39, 25, 0.55);
}
.ha-report__card.hero__form::before {
  display: none;
}
.ha-report__card .hero__form-title {
  color: #024275;
  text-shadow: none;
}
.ha-report__card .hero__form-sub {
  color: #075f86;
}
.ha-report__card .f-field {
  margin-bottom: 16px;
}
.ha-report__card .f-field label {
  color: #075f86;
  font-weight: var(--fw-semibold);
}
.ha-report__card .f-field input,
.ha-report__card .f-field select,
.ha-report__card .hero-cc {
  border-radius: 8px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid rgba(7, 95, 134, 0.2);
  color: #024275;
  box-shadow: none;
}
.ha-report__card .f-field input::placeholder {
  color: rgba(7, 95, 134, 0.5);
}
.ha-report__card .f-field input:focus,
.ha-report__card .f-field select:focus,
.ha-report__card .hero-cc:focus {
  border-color: #075f86;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(7, 95, 134, 0.12);
}
.ha-report__card .f-submit {
  width: 100%;
  margin-top: 8px;
  border-radius: 8px;
  border: 1px solid #9d884f;
  background: #9d884f;
  font-weight: 500;
  font-size: 16px;
}
.ha-report__card .f-submit:hover {
  background: #756437;
  border-color: #756437;
}
.ha-report__card .hero-consent {
  color: #075f86;
}
.ha-report__card .hero-consent a {
  color: var(--alt-color-8);
  font-weight: var(--fw-semibold);
}
.ha-deliver {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ha-deliver .btn {
  width: 100%;
  justify-content: center;
}
.ha-deliver .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.ha-deliver__ok {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: #16a34a;
}
.ha-deliver__ok svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.ha-deliver__hint {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--c-muted);
  text-align: center;
}

/* ===== ADMIN: PASSWORD GATE ===== */
.ha-login {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--g-primary);
  overflow-y: auto;
}
.ha-login__card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  background: var(--c-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px;
}
.ha-login__card img {
  height: 34px;
  width: auto;
  align-self: flex-start;
}
.ha-login__card h1 {
  font-size: var(--fs-h5);
  font-weight: var(--fw-bold);
  margin: 6px 0 0;
  color: var(--c-dark);
}
.ha-login__card > p {
  font-size: var(--fs-sm);
  color: var(--c-muted);
  margin: 0 0 6px;
}

/* ===== ADMIN: SAVED CASES ===== */
.ha-records__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: var(--gap-sm);
}
.ha-records__head h2 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  margin: 4px 0 6px;
}
.ha-records__head .sec-sub {
  margin: 0;
  max-width: 68ch;
}
.ha-records {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.ha-records__table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.ha-records__table th {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-border);
  background: var(--ha-accent-tint);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ha-accent-dark);
  white-space: nowrap;
}
.ha-records__table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-border);
  vertical-align: top;
  line-height: 1.5;
}
.ha-records__table tr:last-child td {
  border-bottom: 0;
}
.ha-records__table tbody tr:nth-child(even) td {
  background: var(--color-05-opacity);
}
.ha-records__table tbody tr:hover td {
  background: var(--alt-color-05-opacity);
}
.ha-records__empty {
  text-align: center;
  color: var(--c-muted);
  padding: 28px 16px;
}
.ha-records__id {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-muted);
}
.ha-records__files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ha-records__file {
  padding: 3px 9px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--c-primary);
  text-decoration: none;
  white-space: nowrap;
}
.ha-records__file:hover {
  background: var(--c-near-white);
}
.ha-records__file--pdf {
  border-color: var(--ha-accent);
  color: var(--ha-accent-dark);
  background: var(--ha-accent-tint);
}

/* ==========================================================================
   SCROLL-REVEAL ANIMATIONS
   Elements tagged .ha-reveal start hidden and fade/slide in once the small
   observer in the page adds .is-in.
   ========================================================================== */
.ha-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}
.ha-reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .ha-spinner {
    animation-duration: 2.4s;
  }
  .ha-progress__row[data-state="active"] .ha-progress__node,
  .ha-progress__loader {
    animation: none;
  }
  .ha-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .ha-card,
  .btn,
  .f-submit {
    transition: none;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 980px) {
  .ha-report__grid {
    grid-template-columns: 1fr;
    gap: var(--gap-md);
    align-items: start;
  }
  .ha-report__intro > p {
    max-width: none;
  }
  .ha-report__card {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }
  /* The CTA-style offset shadow throws ~105px past the card; on a narrow
     viewport that can create a horizontal scrollbar, so it is tamed to a
     centred drop shadow and the hover lift is dropped. */
  .ha-report__card.hero__form,
  .ha-report__card.hero__form:hover {
    transform: none;
    box-shadow: 0 12px 34px -14px rgba(45, 39, 25, 0.4);
  }
}
@media (max-width: 900px) {
  /* Cards stack into a single, comfortably-sized centred column so the 4:3
     drop zone never balloons to full tablet width. */
  .ha-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
  }
  .ha-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ha-drop__label .ha-vec {
    width: 108px;
    height: 94px;
  }
}
@media (max-width: 768px) {
  .ha-hero {
    padding-top: 172px;
    padding-bottom: 36px;
  }
  .ha-hero h1 {
    font-size: var(--fs-h3);
  }
  .ha-hero__steps {
    gap: 10px 18px;
  }
  .ha-card {
    padding: 16px;
  }
  #upload {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  #upload > .wrap > h2 {
    font-size: var(--fs-h4);
    margin-bottom: 8px;
  }
  .ha-drop__label {
    padding: 14px;
    gap: 4px;
  }
  .ha-progress {
    padding: 18px 18px 16px;
    margin-top: var(--gap-sm);
  }
  .ha-progress__head {
    gap: 12px;
    padding-bottom: 14px;
  }
  .ha-summary {
    padding: 18px;
  }
  .ha-final-actions .btn,
  .ha-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .ha-lang {
    width: 100%;
    justify-content: space-between;
  }
  .ha-lang select {
    flex: 0 1 60%;
  }
  .ha-report {
    padding: 3rem 0;
  }
  .ha-report__intro h2 {
    font-size: var(--fs-h4);
  }
  .ha-report__card.hero__form {
    padding: 24px 22px;
  }
  .ha-report__list li {
    font-size: var(--fs-xs);
  }
  .ha-summary__head {
    gap: 6px;
  }
}
@media (max-width: 520px) {
  .ha-stats {
    grid-template-columns: 1fr;
  }
  .ha-hero h1 {
    font-size: var(--fs-h4);
  }
  .ha-hero__step {
    font-size: var(--fs-xs);
  }
  .ha-card,
  .ha-progress {
    padding: 14px;
  }
  #upload,
  .ha-report {
    padding-top: 2.4rem;
    padding-bottom: 2.4rem;
  }
  #upload > .wrap > h2,
  .ha-report__intro h2 {
    font-size: var(--fs-h5);
  }
  .ha-grid {
    max-width: none;
  }
  .ha-report__card.hero__form {
    padding: 20px 16px;
  }
  .ha-doctor__head,
  .ha-doctor__body {
    padding-left: 14px;
    padding-right: 14px;
  }
  .ha-result__head {
    padding: 14px 16px 10px;
  }
  .ha-result__foot {
    padding: 12px 16px 14px;
  }
  .ha-stat {
    padding: 14px;
  }
}
