:root {
  --oracle-red: #c74634;
  --oracle-red-dark: #8d3328;
  --paper: #f5f4f2;
  --white: #ffffff;
  --ink: #161513;
  --muted: #5b5652;
  --border: #d9d6d2;
  --focus: #2458a6;
  --shadow: 0 18px 45px rgba(22, 21, 19, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(199, 70, 52, 0.08), rgba(245, 244, 242, 0) 280px),
    var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 20px 16px 32px;
}

.intro,
.success-screen,
.passport-form,
.form-alert {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.intro {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  align-items: center;
  padding: 20px;
  margin-bottom: 16px;
}

.brand-orb {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--oracle-red);
  color: var(--white);
  font-size: 28px;
  font-weight: 700;
}

.kicker {
  margin: 0 0 4px;
  color: var(--oracle-red-dark);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
legend,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 9vw, 3rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: 1.35rem;
}

.intro p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.form-alert {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-color: #bd3a2d;
  color: #7e241b;
}

.passport-form {
  overflow: hidden;
}

.progress-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--border);
  background: #fbfaf9;
}

.progress-tab {
  min-height: 52px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
}

.progress-tab:last-child {
  border-right: 0;
}

.progress-tab.is-active {
  background: var(--oracle-red);
  color: var(--white);
}

.form-step {
  display: none;
  padding: 20px;
}

.form-step.is-active {
  display: block;
}

.field,
.choice-group {
  margin: 0 0 22px;
}

label,
legend {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 700;
}

fieldset {
  padding: 0;
  border: 0;
}

.helper {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.94rem;
}

input[type='text'],
input[type='email'],
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 11px 12px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(36, 88, 166, 0.28);
  outline-offset: 2px;
}

.chip-grid,
.radio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.chip,
.radio-card {
  position: relative;
  min-height: 48px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfaf9;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.chip input,
.radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span,
.radio-card span {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  overflow-wrap: anywhere;
}

.chip.is-selected,
.radio-card.is-selected {
  border-color: var(--oracle-red);
  background: rgba(199, 70, 52, 0.1);
  color: var(--oracle-red-dark);
}

.other-field {
  display: none;
  margin-top: 12px;
}

.other-field.is-visible {
  display: block;
}

.level-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.level-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfaf9;
}

.level-row label {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.consent {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 400;
}

.consent input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--oracle-red);
}

.error {
  margin: 8px 0 0;
  color: #8d241a;
  font-size: 0.9rem;
  font-weight: 700;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
  background: #fbfaf9;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.primary-action {
  border: 1px solid var(--oracle-red);
  background: var(--oracle-red);
  color: var(--white);
}

.primary-action:hover {
  background: var(--oracle-red-dark);
  border-color: var(--oracle-red-dark);
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.75;
}

.secondary-action {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--ink);
}

.is-submit {
  grid-column: 1 / -1;
}

.success-screen {
  margin-top: 24px;
  padding: 26px 20px;
  text-align: center;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--oracle-red);
  color: var(--white);
  font-size: 4rem;
  font-weight: 700;
}

.success-copy {
  color: var(--muted);
  font-size: 1.08rem;
}

.badge-details {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.badge-details div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfaf9;
}

.badge-details dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-details dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.badge-callout {
  margin: 0 0 18px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(199, 70, 52, 0.1);
  color: var(--oracle-red-dark);
  font-size: 1.12rem;
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

@media (min-width: 640px) {
  .app-shell {
    padding-top: 36px;
  }

  .intro,
  .form-step {
    padding: 28px;
  }

  .chip-grid,
  .radio-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .level-row {
    grid-template-columns: 1fr 210px;
    align-items: center;
  }

  .form-actions {
    grid-template-columns: 160px 1fr;
    padding: 18px 28px 28px;
  }

  .is-submit {
    grid-column: 2;
  }
}
