:root {
  color-scheme: light;
  --ink: #070707;
  --muted: #696973;
  --subtle: #8f8f99;
  --line: #e7e7eb;
  --soft-line: #f1f1f3;
  --paper: #ffffff;
  --panel: #fafafa;
  --panel-strong: #f7f7f8;
  --field: #ffffff;
  --accent: #7c3cff;
  --accent-soft: #f1eaff;
  --accent-line: rgba(124, 60, 255, 0.22);
  --inverse: #ffffff;
  --focus: rgba(0, 0, 0, 0.09);
  --shadow: 0 18px 56px rgba(15, 15, 20, 0.06);
  font-family: "Roboto", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html {
  width: 100%;
  overflow-x: hidden;
  background: #ffffff;
}

body {
  width: 100%;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -20%, rgba(124, 60, 255, 0.06), transparent 32%),
    #ffffff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button,
a,
input,
textarea,
p,
h1,
h2,
h3,
span,
strong,
small,
summary,
pre {
  overflow-wrap: anywhere;
  word-break: normal;
}

h1,
h2,
h3,
p,
pre {
  margin: 0;
}

.app {
  width: min(940px, 100%);
  margin: 0 auto;
  padding: 18px 18px 44px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 10px 4px 10px 20px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.logo {
  display: block;
  width: 132px;
  height: 44px;
  object-fit: contain;
  object-position: left center;
}

.topbar-status {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #2b2b31;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(15, 15, 20, 0.05);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.topbar-status::after {
  content: "";
  position: absolute;
  inset: -4px;
  z-index: -1;
  border-radius: inherit;
  background: rgba(124, 60, 255, 0.08);
  opacity: 0.75;
  animation: glowBreath 2.2s ease-in-out infinite;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 60, 255, 0.1);
  animation: statusPulse 1.6s ease-in-out infinite;
}

.screen {
  animation: screenIn 0.28s ease both;
}

.screen[hidden] {
  display: none !important;
}

.intro {
  max-width: 760px;
  padding: 34px 0 26px;
}

.eyebrow,
.step-counter,
.rating-label {
  margin: 0;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-top: 12px;
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: 0;
}

h3 {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: 0;
}

.intro p:not(.eyebrow),
.result-hero p,
.lead-copy p,
.thanks-shell p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
}

.audit-shell,
.result-shell,
.lead-shell,
.thanks-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(250, 250, 250, 0.92);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.result-shell {
  overflow: visible;
}

.step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 18px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--soft-line);
}

.step-head h2 {
  margin-top: 5px;
}

.step-pill {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: #33333a;
  font-size: 12px;
  font-weight: 500;
}

.progress-track {
  height: 4px;
  background: #eeeeef;
}

.progress-fill {
  width: 20%;
  height: 100%;
  background: #050505;
  transition: width 0.25s ease;
}

.form {
  padding: 24px;
}

.form-step {
  display: none;
  animation: stepIn 0.24s ease both;
}

.form-step.is-active {
  display: grid;
  gap: 20px;
}

.step-copy {
  display: grid;
  gap: 8px;
  max-width: 700px;
}

.step-copy p,
small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.grid {
  display: grid;
  gap: 16px;
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 9px;
  min-width: 0;
}

label span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

input,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 14px;
  color: var(--ink);
  background: var(--field);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.42;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

textarea {
  resize: vertical;
}

input[type="file"] {
  padding: 12px;
}

input::placeholder,
textarea::placeholder {
  color: #a4a4ac;
}

input:focus,
textarea:focus {
  border-color: #111111;
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--focus);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.choice-block {
  display: grid;
  gap: 10px;
}

.choice-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.choice-chips {
  gap: 10px;
}

.choice-chip {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  cursor: pointer;
}

.choice-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice-chip span {
  display: inline-grid;
  min-height: 39px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: #ffffff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.1;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.choice-chip input:focus-visible + span {
  border-color: #111111;
  box-shadow: 0 0 0 4px var(--focus);
}

.choice-chip input:checked + span {
  border-color: #111111;
  background: #070707;
  color: #ffffff;
}

button {
  display: inline-grid;
  min-height: 50px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: var(--inverse);
  background: #070707;
  font-weight: 500;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

button:active {
  transform: translateY(0);
  box-shadow: none;
}

button[disabled] {
  opacity: 0.58;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.secondary-button,
.chip {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
}

.secondary-button:hover,
.chip:hover,
.chip.is-active {
  border-color: #111111;
}

.accent-button {
  background: linear-gradient(135deg, #7c3cff, #8f5cff);
}

.chip {
  min-height: 39px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1.28fr;
  gap: 12px;
  margin-top: 24px;
}

#prevButton[hidden],
#nextButton[hidden],
#submitButton[hidden] {
  display: none;
}

#submitButton {
  grid-column: 2;
}

.review-list {
  display: grid;
  gap: 9px;
}

.review-item {
  display: grid;
  gap: 7px;
  padding: 15px 16px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #ffffff;
}

.review-item span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

.review-item strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  white-space: pre-wrap;
}

.analysis-panel {
  display: grid;
  gap: 14px;
  margin-top: 2px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.analysis-panel[hidden] {
  display: none;
}

.analysis-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.analysis-top strong {
  font-weight: 500;
}

.analysis-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: statusPulse 1.1s ease-in-out infinite;
}

.skeleton-stack {
  display: grid;
  gap: 8px;
}

.skeleton-stack span {
  display: block;
  height: 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, #eeeeef 0%, #f8f8f9 45%, #eeeeef 90%);
  background-size: 200% 100%;
  animation: skeleton 1.3s ease-in-out infinite;
}

.skeleton-stack span:nth-child(2) {
  width: 82%;
}

.skeleton-stack span:nth-child(3) {
  width: 58%;
}

.audit-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.result-screen,
.lead-screen,
.thanks-screen {
  padding-top: 18px;
}

.result-shell {
  background: #ffffff;
}

.result-hero,
.lead-copy,
.thanks-shell {
  padding: 26px 24px 22px;
}

.result-hero h1,
.lead-copy h1,
.thanks-shell h1 {
  margin-top: 10px;
}

.rating-card {
  display: grid;
  grid-template-columns: minmax(0, 210px) minmax(0, 1fr);
  gap: 18px;
  margin: 0 24px 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #fbfaff 100%);
}

.rating-card strong {
  display: block;
  margin-top: 7px;
  font-size: 32px;
  font-weight: 500;
  line-height: 1;
}

.rating-card p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.confidence-block strong {
  margin-top: 7px;
  font-size: 22px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 24px 18px;
}

.kpi-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.kpi-card[data-status="missing"] strong {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.22;
}

.kpi-card span,
.kpi-card small {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}

.kpi-card strong {
  color: var(--ink);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.08;
}

.action-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 0 24px 20px;
}

.action-chip {
  min-height: 38px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
  font-size: 13px;
  font-weight: 500;
}

.action-chip:hover {
  border-color: #111111;
}

.audit-cards {
  display: grid;
  gap: 14px;
  padding: 0 24px 20px;
}

.audit-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: visible;
  animation: cardIn 0.35s ease both;
}

.audit-card:nth-child(2) {
  animation-delay: 0.04s;
}

.audit-card:nth-child(3) {
  animation-delay: 0.08s;
}

.audit-card:nth-child(4) {
  animation-delay: 0.12s;
}

.audit-card:nth-child(5) {
  animation-delay: 0.16s;
}

.audit-card:nth-child(6) {
  animation-delay: 0.2s;
}

.audit-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.audit-icon {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(124, 60, 255, 0.2);
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 15px;
  line-height: 1;
}

.audit-card h3 {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.28;
}

.audit-preview,
.audit-body,
.audit-details,
.audit-list {
  color: #383840;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.58;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.audit-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.audit-list li::marker {
  color: var(--accent);
}

.audit-preview {
  color: var(--muted);
}

.audit-details {
  border-top: 1px solid var(--soft-line);
  padding-top: 11px;
}

.audit-details summary {
  width: max-content;
  max-width: 100%;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.audit-details p {
  margin-top: 10px;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 24px 24px;
}

.lead-shell {
  width: min(620px, 100%);
  margin: 0 auto;
  background: #ffffff;
}

.lead-form {
  display: grid;
  gap: 16px;
  padding: 0 24px 24px;
}

.lead-form button {
  width: 100%;
}

.lead-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.lead-status.is-error {
  color: #b42318;
}

.thanks-shell {
  width: min(620px, 100%);
  margin: 0 auto;
  background: #ffffff;
}

.thanks-shell button {
  width: 100%;
  margin-top: 20px;
}

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

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

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

@keyframes statusPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(124, 60, 255, 0.22);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 8px rgba(124, 60, 255, 0);
    opacity: 0.72;
  }
}

@keyframes glowBreath {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.03);
  }
}

@keyframes skeleton {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@media (max-width: 720px) {
  .app {
    padding: 12px 10px 30px;
  }

  .topbar {
    min-height: 56px;
    padding: 8px 2px 8px 14px;
  }

  .logo {
    width: 120px;
    height: 40px;
  }

  .topbar-status {
    min-height: 31px;
    padding: 0 10px;
    font-size: 12px;
  }

  .intro {
    padding: 24px 2px 20px;
  }

  .intro p:not(.eyebrow),
  .result-hero p,
  .lead-copy p,
  .thanks-shell p {
    font-size: 15px;
  }

  .step-head,
  .form,
  .result-hero,
  .lead-copy,
  .thanks-shell {
    padding: 18px;
  }

  h2 {
    font-size: 21px;
  }

  h3 {
    font-size: 18px;
  }

  .two,
  .form-actions,
  .rating-card,
  .result-actions,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  #submitButton {
    grid-column: auto;
  }

  .rating-card {
    margin: 0 18px 16px;
    padding: 16px;
  }

  .rating-card strong {
    font-size: 29px;
  }

  .kpi-grid,
  .action-strip,
  .audit-cards {
    padding: 0 18px 18px;
  }

  .audit-card {
    padding: 16px;
  }

  .result-actions,
  .lead-form {
    padding: 0 18px 18px;
  }
}

@media (max-width: 390px) {
  .app {
    padding-left: 8px;
    padding-right: 8px;
  }

  .logo {
    width: 112px;
  }

  .topbar-status {
    gap: 6px;
    padding: 0 8px;
  }

  button {
    padding-left: 12px;
    padding-right: 12px;
  }
}
.metrics-details {
  border: 1px solid var(--line, #e8e8ea);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fafafa;
}
.metrics-details summary { cursor: pointer; font-weight: 500; }
.metrics-details > p { color: #6f7078; font-size: 13px; }
