:root {
  color-scheme: light;
  --ink: #142024;
  --muted: #5c6c73;
  --line: #d9e1e4;
  --surface: #f7f8f5;
  --panel: #ffffff;
  --blue: #2364aa;
  --blue-dark: #174d83;
  --teal: #227c70;
  --green: #27835f;
  --yellow: #f0b429;
  --red: #b54848;
  --shadow: 0 18px 50px rgba(22, 39, 45, 0.12);
  --radius: 8px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  letter-spacing: 0;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex: 0 0 auto;
}

button,
input,
select {
  font: inherit;
}

.page {
  width: min(980px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px clamp(16px, 4vw, 32px) 42px;
}

.topbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
  font-size: 20px;
  font-weight: 750;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(35, 100, 170, 0.2);
}

.hero {
  display: grid;
  gap: 18px;
  justify-items: center;
  text-align: center;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

h1,
h2 {
  margin: 0;
  line-height: 1.02;
}

h1 {
  font-size: clamp(38px, 6vw, 62px);
  font-weight: 760;
  max-width: 760px;
}

h2 {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 720;
}

.lede {
  max-width: 700px;
  margin: 16px auto 0;
  color: #405057;
  font-size: clamp(17px, 2.3vw, 21px);
  line-height: 1.45;
}

.safety-note {
  border: 1px solid #ead49a;
  background: #fff9e8;
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: #5b4a18;
  line-height: 1.4;
  text-align: center;
  width: min(100%, 680px);
  margin: 0 auto;
}

.safety-note strong {
  color: #402f00;
}

.form-shell,
.success {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.form-shell {
  overflow: hidden;
}

.form-intro {
  padding: 22px 24px;
  border-bottom: 1px solid #e7ecee;
}

.form-intro p {
  margin: 8px 0 0;
  color: var(--muted);
}

.review-form {
  padding: 22px 24px 24px;
  display: grid;
  gap: 22px;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

legend {
  padding: 0;
  font-size: 17px;
  font-weight: 720;
  margin-bottom: 2px;
}

.field-help {
  margin: -2px 0 2px;
  color: var(--muted);
  line-height: 1.4;
}

.drug-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.drug-option {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 560;
}

.drug-option input {
  accent-color: var(--blue);
}

.drug-option:has(input:checked) {
  border-color: var(--blue);
  background: #f4f8ff;
  box-shadow: inset 0 0 0 1px var(--blue);
  color: var(--blue-dark);
}

.upload-drop {
  position: relative;
  border: 1px dashed #bac8cd;
  border-radius: var(--radius);
  background: #fbfcfa;
  padding: 26px 20px;
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
}

.upload-drop.added {
  border-style: solid;
  border-color: #a8d4c0;
  background: #f3fbf6;
}

.upload-drop.drag-over {
  border-color: var(--blue);
  background: #f4f8ff;
}

.upload-icon {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #edf5f3;
  color: var(--teal);
  margin-bottom: 2px;
}

.upload-drop strong {
  font-size: 18px;
  font-weight: 720;
}

.upload-drop span:not(.upload-icon) {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  max-width: 520px;
}

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

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 720;
  margin-top: 6px;
  box-shadow: 0 8px 16px rgba(35, 100, 170, 0.18);
}

.upload-drop em {
  color: var(--teal);
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
}

.fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.fields label {
  display: grid;
  gap: 6px;
}

.fields label > span {
  color: #46555b;
  font-size: 13px;
  font-weight: 680;
}

.fields input,
.fields select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.fields input:focus,
.fields select:focus,
.drug-option:focus-within,
.upload-drop:focus-within {
  outline: 3px solid rgba(35, 100, 170, 0.18);
  border-color: var(--blue);
}

.wide {
  grid-column: 1 / -1;
}

.consent {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  color: #506168;
  font-size: 14px;
  line-height: 1.4;
}

.consent input {
  margin-top: 2px;
  accent-color: var(--blue);
}

.submit-button,
.secondary-button {
  min-height: 52px;
  border: 0;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 720;
  cursor: pointer;
}

.submit-button {
  width: 100%;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 20px rgba(35, 100, 170, 0.22);
}

.submit-button[disabled] {
  opacity: 0.72;
  cursor: wait;
}

.secondary-button {
  background: #eef4f3;
  color: #164b45;
  border: 1px solid #cfe0dc;
  padding: 0 18px;
}

.form-status {
  min-height: 20px;
  margin: -10px 0 0;
  color: var(--muted);
}

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

.success {
  margin-top: 22px;
  padding: 32px 24px;
  text-align: center;
}

.success:focus {
  outline: 0;
}

.success-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  margin: 0 auto 16px;
}

.success p {
  max-width: 620px;
  margin: 12px auto 0;
  color: var(--muted);
  line-height: 1.5;
}

.case-line {
  color: var(--ink) !important;
}

.success .secondary-button {
  margin-top: 22px;
}

.footer {
  width: 100%;
  margin: 0 auto;
  padding: 46px 16px 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .page {
    padding-top: 16px;
  }

  .topbar {
    margin-bottom: 24px;
  }

  .hero {
    gap: 16px;
  }

  h1 {
    font-size: 40px;
  }

  .form-intro,
  .review-form {
    padding: 18px;
  }

  .drug-grid,
  .fields {
    grid-template-columns: 1fr;
  }

  .upload-drop {
    min-height: 190px;
    padding: 20px 16px;
  }
}

@media (max-width: 390px) {
  h1 {
    font-size: 38px;
  }

  .form-intro,
  .review-form {
    padding: 16px;
  }
}
