:root {
  --sdb-bg: #071312;
  --sdb-surface: #0d1d1b;
  --sdb-surface-raised: #132724;
  --sdb-border: rgba(213, 246, 238, 0.14);
  --sdb-text: #f5fbf9;
  --sdb-muted: #a9bbb7;
  --sdb-accent: #bafc69;
  --sdb-accent-strong: #a9ef54;
  --sdb-accent-ink: #10200e;
  --sdb-error: #ff8f8f;
  --sdb-focus: #d7ff9f;
  --sdb-radius-lg: 28px;
  --sdb-radius-md: 16px;
  --sdb-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 10%, rgba(67, 146, 125, 0.17), transparent 36rem),
    radial-gradient(circle at 90% 85%, rgba(186, 252, 105, 0.08), transparent 30rem),
    var(--sdb-bg);
  color: var(--sdb-text);
}

button,
input,
select {
  font: inherit;
}

button,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  display: flex;
  width: min(100% - 32px, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 22px;
  flex-direction: column;
}

.brand {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  margin-bottom: 24px;
  color: var(--sdb-text);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand strong {
  color: var(--sdb-accent);
  font-weight: 800;
}

.brand__mark {
  display: grid;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: var(--sdb-accent);
  color: var(--sdb-accent-ink);
  font-size: 16px;
  font-weight: 800;
  place-items: center;
  transform: rotate(-5deg);
}

.insurance-quiz {
  margin: auto 0;
}

.quiz-card {
  overflow: hidden;
  border: 1px solid var(--sdb-border);
  border-radius: var(--sdb-radius-lg);
  background: linear-gradient(145deg, rgba(17, 39, 35, 0.97), rgba(10, 27, 25, 0.98));
  box-shadow: var(--sdb-shadow);
}

.quiz-progress {
  padding: 22px 22px 0;
}

.quiz-progress__meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--sdb-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quiz-progress__track {
  overflow: hidden;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.quiz-progress__bar {
  display: block;
  width: 25%;
  height: 100%;
  border-radius: inherit;
  background: var(--sdb-accent);
  transition: width 260ms ease;
}

.step-shell {
  padding: 34px 22px 24px;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.step-shell--visible {
  opacity: 1;
  transform: none;
}

.step-heading {
  margin-bottom: 28px;
}

.step-heading__eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--sdb-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.step-heading h1,
.success-state h1 {
  max-width: 620px;
  margin: 0;
  color: var(--sdb-text);
  font-size: clamp(27px, 6.8vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.step-heading p,
.success-state p {
  max-width: 590px;
  margin: 12px 0 0;
  color: var(--sdb-muted);
  font-size: 15px;
  line-height: 1.6;
}

.field-grid,
.step-content {
  display: grid;
  gap: 20px;
}

.field-grid--split {
  grid-template-columns: 1fr;
}

.plate-lookup {
  display: grid;
  align-items: end;
  gap: 10px;
}

.plate-lookup[hidden] {
  display: none;
}

.button--secondary {
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(186, 252, 105, 0.35);
  background: rgba(186, 252, 105, 0.08);
  color: var(--sdb-accent);
}

.button--secondary:hover {
  border-color: var(--sdb-accent);
  background: rgba(186, 252, 105, 0.13);
}

.manual-entry-link {
  width: fit-content;
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid rgba(169, 187, 183, 0.4);
  background: transparent;
  color: var(--sdb-muted);
  cursor: pointer;
  font-size: 12px;
}

.manual-entry-link:hover,
.manual-entry-link:focus-visible {
  border-color: var(--sdb-accent);
  color: var(--sdb-accent);
}

.vehicle-lookup-status {
  color: var(--sdb-muted);
  font-size: 13px;
  line-height: 1.5;
}

.vehicle-lookup-status:empty {
  display: none;
}

.vehicle-lookup-status--error {
  color: var(--sdb-error);
}

.vehicle-lookup-status--success {
  color: #ccecb2;
}

.vehicle-result {
  display: flex;
  padding: 16px;
  border: 1px solid rgba(186, 252, 105, 0.3);
  border-radius: 15px;
  align-items: flex-start;
  gap: 12px;
  background: rgba(186, 252, 105, 0.07);
}

.vehicle-result__check {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--sdb-accent);
  color: var(--sdb-accent-ink);
  font-size: 14px;
  font-weight: 900;
  place-items: center;
}

.vehicle-result__body {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.vehicle-result__body strong {
  color: var(--sdb-text);
  line-height: 1.35;
}

.vehicle-result__body > span:last-child,
.vehicle-result__eyebrow {
  color: var(--sdb-muted);
  font-size: 12px;
}

.vehicle-result__eyebrow {
  color: var(--sdb-accent);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.vehicle-result__fipe {
  display: grid;
  gap: 5px;
  padding: 0 4px;
  color: #dce9e5;
  font-size: 13px;
  line-height: 1.45;
}

.vehicle-result__fipe span {
  color: var(--sdb-muted);
  font-size: 12px;
}

.fipe-candidates {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.fipe-candidates__list {
  display: grid;
  gap: 8px;
}

.fipe-candidate {
  position: relative;
  display: flex;
  padding: 13px 14px;
  border: 1px solid var(--sdb-border);
  border-radius: 13px;
  align-items: flex-start;
  gap: 11px;
  background: rgba(4, 16, 14, 0.42);
  cursor: pointer;
}

.fipe-candidate:has(input:checked) {
  border-color: var(--sdb-accent);
  background: rgba(186, 252, 105, 0.08);
}

.fipe-candidate input {
  margin-top: 3px;
  accent-color: var(--sdb-accent);
}

.fipe-candidate span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.fipe-candidate strong {
  color: var(--sdb-text);
  font-size: 13px;
  line-height: 1.4;
}

.fipe-candidate small {
  color: var(--sdb-muted);
  font-size: 11px;
  line-height: 1.4;
}

.field {
  min-width: 0;
}

.field__label {
  display: block;
  margin: 0 0 9px;
  color: #dfeae7;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.field__input {
  width: 100%;
  min-height: 54px;
  padding: 0 15px;
  border: 1px solid var(--sdb-border);
  border-radius: 13px;
  outline: none;
  background: rgba(4, 16, 14, 0.55);
  color: var(--sdb-text);
  font-size: 16px;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.field__input::placeholder {
  color: #748782;
}

.field__input:hover {
  border-color: rgba(213, 246, 238, 0.28);
}

.field__input:focus {
  border-color: var(--sdb-focus);
  background: rgba(4, 16, 14, 0.8);
  box-shadow: 0 0 0 3px rgba(186, 252, 105, 0.12);
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 17px;
  color: var(--sdb-muted);
  content: "⌄";
  pointer-events: none;
  transform: translateY(-55%);
}

.field__select {
  padding-right: 44px;
  appearance: none;
}

.field__hint,
.field__error {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.45;
}

.field__hint {
  color: var(--sdb-muted);
}

.field__error {
  min-height: 0;
  color: var(--sdb-error);
}

.field__error:empty {
  display: none;
}

.has-error .field__input {
  border-color: var(--sdb-error);
}

.choices-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

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

.choice-grid--compact {
  grid-template-columns: repeat(2, 1fr);
}

.choice-card {
  position: relative;
  display: flex;
  min-height: 57px;
  padding: 13px 15px;
  border: 1px solid var(--sdb-border);
  border-radius: 14px;
  align-items: center;
  gap: 12px;
  background: rgba(4, 16, 14, 0.44);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.choice-card:hover {
  border-color: rgba(186, 252, 105, 0.42);
  background: rgba(18, 43, 38, 0.75);
}

.choice-card:has(input:focus-visible) {
  outline: 3px solid rgba(186, 252, 105, 0.23);
  outline-offset: 2px;
}

.choice-card:has(input:checked) {
  border-color: var(--sdb-accent);
  background: rgba(186, 252, 105, 0.1);
}

.choice-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice-card__control {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 1px solid #658079;
  border-radius: 50%;
  place-items: center;
}

.choice-card__control::after {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sdb-accent-ink);
  content: "";
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 150ms ease, transform 150ms ease;
}

.choice-card--checkbox .choice-card__control {
  border-radius: 6px;
}

.choice-card--checkbox .choice-card__control::after {
  width: 8px;
  height: 4px;
  border: 0;
  border-bottom: 2px solid var(--sdb-accent-ink);
  border-left: 2px solid var(--sdb-accent-ink);
  border-radius: 0;
  background: transparent;
  transform: translateY(-1px) rotate(-45deg) scale(0.6);
}

.choice-card--checkbox input:checked + .choice-card__control::after {
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

input:checked + .choice-card__control {
  border-color: var(--sdb-accent);
  background: var(--sdb-accent);
}

input:checked + .choice-card__control::after {
  opacity: 1;
  transform: scale(1);
}

.choice-card__label {
  display: block;
  color: #eaf4f1;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.choice-card__description {
  display: block;
  margin-top: 4px;
  color: var(--sdb-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.context-feedback {
  display: flex;
  padding: 14px 15px;
  border: 1px solid rgba(186, 252, 105, 0.2);
  border-radius: 14px;
  align-items: flex-start;
  gap: 10px;
  background: rgba(186, 252, 105, 0.07);
  color: #dcebd7;
}

.context-feedback[hidden] {
  display: none;
}

.context-feedback > span {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--sdb-accent);
  color: var(--sdb-accent-ink);
  font-size: 12px;
  font-weight: 900;
  place-items: center;
}

.context-feedback p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.conditional-fields {
  display: grid;
  gap: 20px;
  padding-top: 8px;
  animation: reveal 180ms ease both;
}

.conditional-fields[hidden] {
  display: none;
}

.conditional-panel {
  display: grid;
  gap: 20px;
  animation: reveal 180ms ease both;
}

.conditional-panel[hidden],
[data-auto-features][hidden],
[data-work-parking][hidden] {
  display: none;
}

.conditional-panel--spaced {
  margin-top: 20px;
}

.form-subsection {
  display: grid;
  gap: 18px;
  padding-top: 24px;
  border-top: 1px solid var(--sdb-border);
}

.form-subsection__heading h2 {
  margin: 0;
  color: var(--sdb-text);
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.form-subsection__heading p {
  margin: 6px 0 0;
  color: var(--sdb-muted);
  font-size: 13px;
  line-height: 1.5;
}

.form-subsection__content {
  display: grid;
  gap: 20px;
}

.field-note {
  padding: 13px 15px;
  border: 1px solid rgba(186, 252, 105, 0.16);
  border-radius: 13px;
  background: rgba(186, 252, 105, 0.055);
  color: #c9d8d4;
  font-size: 12px;
  line-height: 1.55;
}

.toggle-field {
  min-width: 0;
}

.optional-disclosure {
  display: flex;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px dashed rgba(213, 246, 238, 0.14);
  border-radius: 12px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(4, 16, 14, 0.2);
}

.optional-disclosure__label,
.optional-disclosure__status {
  display: block;
}

.optional-disclosure__label {
  color: #c7d6d2;
  font-size: 13px;
  font-weight: 650;
}

.optional-disclosure__status {
  margin-top: 2px;
  color: #71837f;
  font-size: 11px;
}

.optional-disclosure__button {
  padding: 7px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--sdb-accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.optional-disclosure__button:hover {
  background: rgba(186, 252, 105, 0.08);
}

.optional-disclosure__button:focus-visible,
.social-name-dialog__close:focus-visible {
  outline: 3px solid rgba(215, 255, 159, 0.28);
  outline-offset: 2px;
}

.social-name-dialog {
  width: min(calc(100% - 32px), 480px);
  max-height: min(680px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--sdb-border);
  border-radius: 20px;
  background: var(--sdb-surface-raised);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  color: var(--sdb-text);
}

.social-name-dialog::backdrop {
  background: rgba(1, 8, 7, 0.76);
  backdrop-filter: blur(5px);
}

.social-name-dialog__content {
  padding: 24px;
}

.social-name-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.social-name-dialog__header h2 {
  margin: 0;
  color: var(--sdb-text);
  font-size: 22px;
  letter-spacing: -0.035em;
}

.social-name-dialog__close {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--sdb-muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  place-items: center;
}

.social-name-dialog__description {
  margin: 12px 0 20px;
  color: var(--sdb-muted);
  font-size: 13px;
  line-height: 1.55;
}

.social-name-dialog__actions {
  display: flex;
  margin-top: 24px;
  justify-content: flex-end;
  gap: 10px;
}

.social-name-dialog__actions .button--primary {
  width: auto;
  min-width: 120px;
}

.has-error > .choice-grid .choice-card,
.toggle-field.has-error .choice-card {
  border-color: var(--sdb-error);
}

.quiz-actions {
  display: flex;
  margin-top: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quiz-actions__spacer {
  display: none;
}

.button {
  display: inline-flex;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.button:focus-visible {
  outline: 3px solid rgba(215, 255, 159, 0.38);
  outline-offset: 3px;
}

.button--primary {
  width: 100%;
  padding: 0 20px;
  background: var(--sdb-accent);
  box-shadow: 0 10px 28px rgba(80, 140, 27, 0.19);
  color: var(--sdb-accent-ink);
}

.button--primary:hover {
  background: var(--sdb-accent-strong);
  box-shadow: 0 14px 32px rgba(80, 140, 27, 0.25);
  transform: translateY(-1px);
}

.button--back {
  min-width: auto;
  padding: 0 8px;
  background: transparent;
  color: var(--sdb-muted);
}

.button--back:hover {
  color: var(--sdb-text);
}

.button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.form-status {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.form-status:empty {
  display: none;
}

.form-status--error {
  color: var(--sdb-error);
}

.success-state {
  display: flex;
  min-height: 480px;
  padding: 48px 24px;
  outline: 0;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.success-state__icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
  border-radius: 50%;
  background: var(--sdb-accent);
  box-shadow: 0 0 0 10px rgba(186, 252, 105, 0.08);
  color: var(--sdb-accent-ink);
  font-size: 28px;
  font-weight: 900;
  place-items: center;
}

.page-note {
  margin: 22px auto 0;
  color: #758984;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@media (min-width: 640px) {
  .page-shell {
    width: min(100% - 56px, 760px);
    padding: 36px 0 26px;
  }

  .brand {
    margin-bottom: 32px;
  }

  .quiz-progress {
    padding: 28px 38px 0;
  }

  .step-shell {
    padding: 42px 38px 36px;
  }

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

  .plate-lookup {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .plate-lookup .button--secondary {
    margin-bottom: 1px;
  }

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

  .choice-grid--compact {
    max-width: 420px;
  }

  .quiz-actions__spacer {
    display: block;
  }

  .button--primary {
    width: auto;
    min-width: 190px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
