:root {
  font-family: Inter, Arial, sans-serif;
  color: #f2f2f2;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  min-height: 100%;
  background-color: #050505;
  background-image: url("/diagnostic-background-desktop.jpg");
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  background: transparent;
  color: #f2f2f2;
  line-height: 1.5;
}

.diagnostic {
  position: relative;
  width: min(760px, calc(100% - 40px));
  margin: 72px auto 104px;
}

.diagnostic-active .lead { display: none; }
.diagnostic-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.eyebrow {
  margin: 0;
  color: #8caeff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.site-return {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  color: rgba(255,255,255,.84);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.site-return:hover {
  border-color: rgba(140,174,255,.72);
  background: rgba(93,132,255,.12);
  color: #fff;
}

.diagnostic h1 {
  max-width: 690px;
  margin: 0;
  font-size: clamp(34px, 4.2vw, 52px);
  line-height: 1.08;
  letter-spacing: -.045em;
}

.lead {
  max-width: 610px;
  margin: 18px 0 0;
  color: rgba(255,255,255,.65);
  font-size: 17px;
  line-height: 1.62;
}

form {
  display: grid;
  gap: 20px;
  margin-top: 38px;
  padding: 30px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
}

label {
  display: grid;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
}

label span {
  color: rgba(255,255,255,.65);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
}

textarea,
input,
select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 11px;
  background: rgba(20,22,25,.78);
  color: #f2f2f2;
  font: inherit;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

textarea {
  min-height: 102px;
  line-height: 1.5;
  resize: vertical;
}

textarea::placeholder,
input::placeholder { color: rgba(255,255,255,.52); }

textarea:hover,
input:hover,
select:hover { border-color: rgba(255,255,255,.30); }

textarea:focus-visible,
input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 0;
  border-color: rgba(255,255,255,.48);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08);
}

select {
  appearance: none;
  padding-right: 48px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='m7.5 9.5 4.5 4.5 4.5-4.5' fill='none' stroke='%23f2f2f2' stroke-opacity='.8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 24px;
}

input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  padding-right: 48px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Crect x='4.5' y='5.5' width='15' height='14' rx='2' fill='none' stroke='%23f2f2f2' stroke-opacity='.92' stroke-width='1.6'/%3E%3Cpath d='M8 3.75v3.5M16 3.75v3.5M4.5 10h15' fill='none' stroke='%23f2f2f2' stroke-opacity='.92' stroke-linecap='round' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 22px;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
}

textarea:disabled,
input:disabled,
select:disabled,
button:disabled {
  border-color: rgba(255,255,255,.12);
  background: rgba(20,22,25,.50);
  color: rgba(242,242,242,.52);
  box-shadow: none;
  cursor: not-allowed;
  opacity: .72;
}

textarea:-webkit-autofill,
input:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: #f2f2f2;
  -webkit-box-shadow: 0 0 0 1000px rgb(20,22,25) inset;
  caret-color: #f2f2f2;
}

.rights {
  grid-template-columns: 26px minmax(0,1fr);
  align-items: start;
  gap: 12px;
  padding: 2px 0;
  font-size: 14px;
  line-height: 1.5;
}

.rights input[type="checkbox"],
.contact-choices input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  display: grid;
  place-content: center;
  inline-size: 24px !important;
  block-size: 24px !important;
  min-inline-size: 24px !important;
  min-block-size: 24px !important;
  max-inline-size: 24px !important;
  max-block-size: 24px !important;
  margin: 2px 0 0;
  padding: 0 !important;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50% !important;
  background: rgba(20,22,25,.78);
  box-shadow: none;
  accent-color: transparent;
  aspect-ratio: 1 / 1 !important;
}

.rights input[type="checkbox"]::after,
.contact-choices input[type="checkbox"]::after,
input[type="radio"]::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f2f2f2;
  box-shadow: none;
  transform: scale(0);
  transition: transform .16s ease;
}

.rights input[type="checkbox"]:checked,
.contact-choices input[type="checkbox"]:checked,
input[type="radio"]:checked {
  border-color: rgba(255,255,255,.75);
  background: rgba(255,255,255,.18);
}

.rights input[type="checkbox"]:checked::after,
.contact-choices input[type="checkbox"]:checked::after,
input[type="radio"]:checked::after { transform: scale(1); }

.privacy {
  margin: 0;
  color: rgba(255,255,255,.62);
  font-size: 13px;
  line-height: 1.55;
}

.privacy a {
  color: rgba(255,255,255,.78);
  font-weight: 700;
}

button {
  position: relative;
  min-height: 50px;
  overflow: hidden;
  padding: 14px 18px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 11px;
  background: rgba(20,22,25,.88);
  color: #f2f2f2;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 9px 24px rgba(0,0,0,.32);
  font: inherit;
  font-weight: 700;
  letter-spacing: -.01em;
  text-shadow: 0 1px 1px rgba(0,0,0,.72);
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease, border-color .16s ease;
}

button::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.09), transparent 40%);
  pointer-events: none;
}

button:hover {
  border-color: rgba(255,255,255,.38);
  background: rgba(40,42,45,.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 12px 28px rgba(0,0,0,.42);
  transform: translateY(-1px);
}

button:active {
  border-color: rgba(255,255,255,.30);
  background: rgba(12,14,17,.92);
  box-shadow: none;
  transform: translateY(1px);
}

#status {
  min-height: 24px;
  margin: 16px 0 0;
  color: rgba(255,255,255,.65);
  font-size: 14px;
  line-height: 1.5;
}

#diagnostic-progress,
#result {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  background: rgba(20,22,25,.78);
  box-shadow: none;
}

#diagnostic-progress {
  display: grid;
  gap: 12px;
  margin: 30px 0;
  padding: 22px;
}

.progress-copy p { margin: 0; }
.progress-copy p:first-child {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.progress-hint {
  margin-top: 5px !important;
  color: rgba(255,255,255,.65);
  font-size: 14px;
}

.logo-runway {
  position: relative;
  height: 48px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  background: rgba(255,255,255,.08);
}

.logo-runway::before {
  content: '';
  position: absolute;
  top: 22px;
  left: 12px;
  width: 24px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1877f2, #67d9ff);
  box-shadow: 0 0 12px rgba(72,191,255,.72);
  animation: progress-indicator-run 2.2s ease-in-out infinite alternate;
}

.progress-logo {
  position: absolute;
  top: 11px;
  left: 50%;
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: .35;
  filter: grayscale(1) brightness(1.7);
  transform: translateX(-50%);
}

@keyframes progress-indicator-run {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw - 160px)); }
}

#result {
  margin-top: 32px;
  padding: 30px;
}

#result h2 {
  margin-top: 0;
  font-size: clamp(26px,3vw,34px);
  line-height: 1.15;
  letter-spacing: -.035em;
}

#result h3 {
  margin: 28px 0 9px;
  color: #a9bdde;
  font-size: 14px;
  letter-spacing: .01em;
  text-transform: uppercase;
}

.result-heading,
.success-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.result-heading h2 { flex: 1; }
.diagnostic-reference {
  margin: 6px 0 20px;
  color: rgba(255,255,255,.65);
  font-size: 13px;
  letter-spacing: .04em;
}

.download-pdf,
.close-success {
  min-height: auto;
  padding: 9px 13px;
  border-color: rgba(255,255,255,.24);
  border-radius: 999px;
  background: rgba(20,22,25,.78);
  color: #f2f2f2;
  box-shadow: none;
  white-space: nowrap;
}

.download-pdf:hover,
.close-success:hover {
  background: rgba(40,42,45,.92);
  box-shadow: none;
}

.fact,
.metric-insight,
.limited-value {
  border-left: 2px solid rgba(255,255,255,.35);
  border-radius: 0 10px 10px 0;
  background: rgba(20,22,25,.78);
  color: rgba(255,255,255,.78);
}

.fact { padding: 11px 0 11px 14px; }
.metric-insight { margin: 14px 0; padding: 13px 14px; }
.limited-value { margin: 16px 0; padding: 11px 14px; }
.muted { color: rgba(255,255,255,.65); }

.seo-report {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  background: rgba(20,22,25,.78);
}

.seo-report h3 { margin-top: 0; }
.seo-report strong { color: #f2f2f2; font-size: 24px; }
.seo-report ul { padding-left: 19px; color: rgba(255,255,255,.75); }

.turnstile-wrapper {
  display: grid;
  gap: 8px;
  padding: 13px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  background: rgba(20,22,25,.78);
}

.turnstile-wrapper p { margin: 0; color: rgba(255,255,255,.65); font-size: 12px; }
.turnstile-wrapper #human-verification { min-height: 65px; max-width: 100%; overflow: hidden; }
.turnstile-wrapper iframe { max-width: 100%; }

.contact-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 18px;
  padding: 0;
  border: 0;
}

.contact-choices legend { margin-bottom: 10px; font-weight: 700; }
.contact-choices label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

[id$="-contact-fields"] { display: grid; gap: 16px; margin: 18px 0 22px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.result-actions button { flex: 0 1 auto; margin: 0; }

.temporary-result-form { display: grid; gap: 16px; margin: 24px 0 0; }
.temporary-result-form label { margin: 0; }
.temporary-result-actions { margin-top: 24px; }
.clarification-form { padding-bottom: 2px; }
.question-dialog p { margin: 0; color: rgba(255,255,255,.65); }
.next-step-list { display: grid; gap: 10px; margin: 12px 0 0; padding-left: 24px; }
.next-step-list li { padding-left: 4px; }
#result .contact-fields + .rights { margin-top: 12px; }

.back-to-intake,
.close-thank-you {
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  border-radius: 50% !important;
  line-height: 1 !important;
  aspect-ratio: 1 / 1 !important;
}

.back-to-intake {
  flex: 0 0 44px;
  width: 44px;
  min-height: 44px;
  height: 44px;
  font-size: 24px;
}

.close-thank-you {
  inline-size: 48px !important;
  block-size: 48px !important;
  min-inline-size: 48px !important;
  min-block-size: 48px !important;
  max-inline-size: 48px !important;
  max-block-size: 48px !important;
  margin: 18px 0 24px;
  font-size: 28px !important;
}

@media (min-width: 700px) {
  @keyframes progress-indicator-run {
    from { transform: translateX(0); }
    to { transform: translateX(500px); }
  }

  .turnstile-wrapper { grid-template-columns: 1fr auto; align-items: center; }
  .turnstile-wrapper p { max-width: 220px; }
}

@media (max-width: 700px) {
  html {
    background-image: url("/diagnostic-background-mobile.jpg");
    background-position: center top;
  }

  .diagnostic { width: min(100% - 28px,560px); margin: 38px auto 72px; }
  .diagnostic-topbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .diagnostic h1 { font-size: 34px; }
  .lead { font-size: 16px; }
  form { margin-top: 28px; padding: 20px 16px; border-radius: 15px; gap: 18px; }
  #result { padding: 22px 18px; border-radius: 15px; }
  .result-heading,
  .success-heading { align-items: flex-start; flex-direction: column; }
  .result-actions { display: grid; grid-template-columns: 1fr; }
  .result-actions button { width: 100%; }
  .download-pdf,
  .close-success { width: auto; }
  .rights { font-size: 13px; }
  .contact-choices { display: grid; grid-template-columns: 1fr; }
  .contact-choices label { justify-content: flex-start; }
  .back-to-intake { flex-basis: 42px; width: 42px; min-height: 42px; height: 42px; }
  .close-thank-you {
    inline-size: 44px !important;
    block-size: 44px !important;
    min-inline-size: 44px !important;
    min-block-size: 44px !important;
    max-inline-size: 44px !important;
    max-block-size: 44px !important;
  }
}

@media (max-width: 390px) {
  .diagnostic { width: calc(100% - 24px); }
  .diagnostic h1 { font-size: 31px; }
  form { padding: 18px 14px; }
  textarea,
  input,
  select { font-size: 16px; }
}
