.intake-page {
  display: grid;
  gap: 18px;
}

.intake-header {
  display: grid;
  gap: 10px;
}

.intake-intro {
  margin: 0;
  color: var(--color-muted);
  font-size: 16px;
}

.intake-status {
  padding: 12px 14px;
  border-width: 2px;
}

.intake-status p {
  margin: 0;
  font-size: 14px;
}

.intake-status p + p {
  margin-top: 6px;
}

.intake-status a {
  color: var(--color-blue-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.intake-form {
  padding: 16px;
  display: grid;
  gap: 18px;
}

.intake-section {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 16px;
}

.intake-section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.intake-section h2 {
  margin: 0;
  color: var(--color-blue-dark);
  font-size: 22px;
}

.intake-grid {
  display: grid;
  gap: 12px;
}

.intake-grid.one {
  grid-template-columns: 1fr;
}

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

.intake-grid label,
.intake-checkboxes label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: #24313d;
}

.intake-grid input,
.intake-grid select,
.intake-grid textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  min-height: 42px;
  padding: 8px 10px;
  font: inherit;
}

.intake-grid textarea {
  min-height: 88px;
  resize: vertical;
}

.intake-grid input:focus,
.intake-grid select:focus,
.intake-grid textarea:focus {
  outline: 2px solid #5c87a133;
  border-color: var(--color-blue);
}

.intake-checkboxes {
  border: 1px dashed var(--color-border);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.intake-checkboxes legend {
  padding: 0 6px;
  color: #24313d;
  font-weight: 700;
}

.intake-checkboxes label {
  font-weight: 500;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
}

.intake-checkboxes input[type="checkbox"] {
  margin-top: 3px;
}

.intake-actions {
  display: grid;
  gap: 10px;
}

.intake-actions__buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.turnstile-check {
  min-height: 65px;
  display: flex;
  justify-content: flex-end;
}

.intake-actions .btn {
  min-width: 170px;
  border: 1px solid var(--color-border);
  background: #f2f5f7;
  color: #24313d;
}

.intake-actions .btn.btn-primary {
  border-color: transparent;
  background: var(--color-red);
  color: #fff;
}

.intake-error {
  min-height: 20px;
  margin: 0;
  color: #a12c11;
  font-weight: 600;
}

.intake-confirmation {
  padding: 16px;
}

.intake-confirmation h2 {
  margin: 0;
  color: var(--color-blue-dark);
}

.intake-confirmation p {
  margin: 8px 0 0;
}

.intake-confirmation__stamp {
  color: var(--color-muted, #5a6470);
  font-size: 15px;
}

.intake-confirmation:focus-visible {
  outline: 3px solid var(--color-blue);
  outline-offset: 3px;
}

.panel-list {
  display: grid;
  gap: 10px;
}

.panel-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  font-weight: 600;
}

.panel-item:hover {
  border-color: var(--color-blue);
  background: #f6fbff;
}

.intake-section h3 {
  margin: 8px 0 -4px;
  color: #24313d;
  font-size: 17px;
}

.intake-note {
  margin: 0;
  color: var(--color-muted);
  font-size: 14px;
}

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

/* One question with a short closed list of answers, as chips. Mirrors the
   check-one boxes on the paper forms without a select hiding the options. */
.intake-choices {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: #24313d;
}

.intake-choices__options,
.yn-row__options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.intake-grid .intake-choices__options label,
.intake-grid .yn-row__options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 6px 12px;
  background: #fff;
  font-weight: 500;
  cursor: pointer;
}

.intake-grid .yn-row__options label {
  min-width: 68px;
  justify-content: center;
}

.intake-choices__options label:has(input:checked),
.yn-row__options label:has(input:checked) {
  border-color: var(--color-blue);
  background: #e7f1f8;
}

.intake-grid .intake-choices__options input,
.intake-grid .yn-row__options input {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--color-blue);
}

/* Yes / No question lists: the symptom review, habits, review of systems. */
.yn-list {
  display: grid;
}

.yn-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 16px;
  padding: 8px 0;
  border-bottom: 1px solid #eef1f4;
}

.yn-row:last-child {
  border-bottom: 0;
}

.yn-row__label {
  font-weight: 600;
  color: #24313d;
}

/* The paper form's "Describe" blank beside a yes/no. */
.yn-row--detail {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.1fr);
}

.intake-grid .yn-row--detail input[type="text"] {
  min-height: 38px;
  padding: 6px 10px;
}

/* Prior cardiac tests: name, date, normal/abnormal. */
.intake-test-row,
.intake-family-row {
  display: grid;
  align-items: center;
  gap: 8px 14px;
  padding: 8px 0;
  border-bottom: 1px solid #eef1f4;
}

.intake-test-row:last-child,
.intake-family-row:last-child {
  border-bottom: 0;
}

.intake-test-row {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
}

.intake-family-row {
  grid-template-columns: 96px auto minmax(0, 0.5fr) minmax(0, 1.5fr);
}

.intake-test-row__label,
.intake-family-row__label {
  font-weight: 600;
  color: #24313d;
}

.intake-grid .intake-test-row input,
.intake-grid .intake-family-row input {
  min-height: 38px;
  padding: 6px 10px;
}

/* Numbered rows: medications 1-8, procedures 1-4. */
.intake-repeat {
  display: grid;
  gap: 10px;
}

.intake-repeat-row {
  display: grid;
  align-items: center;
  gap: 10px;
}

.intake-repeat-row--single {
  grid-template-columns: 28px minmax(0, 1fr);
}

.intake-repeat-row--medication {
  grid-template-columns: 28px repeat(4, minmax(0, 1fr));
}

.intake-repeat-head {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.intake-repeat-row__index {
  font-weight: 700;
  color: var(--color-muted);
}

.intake-add-row {
  justify-self: start;
  min-height: 36px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0 16px;
  background: #f2f5f7;
  color: #24313d;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.intake-add-row:hover {
  border-color: var(--color-blue);
  background: #e7f1f8;
}

/* The signed blocks from the paper form: the wording, then a typed name and
   a date in place of a signature line. */
.intake-agreement {
  display: grid;
  gap: 12px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fbfcfd;
}

.intake-agreement h3 {
  margin: 0;
}

.intake-agreement p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .intake-grid.two,
  .intake-grid.three {
    grid-template-columns: 1fr;
  }

  .yn-row--detail {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .yn-row--detail input[type="text"] {
    grid-column: 1 / -1;
  }

  .intake-test-row,
  .intake-family-row {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .intake-repeat-row--medication .intake-repeat-row__index {
    grid-column: 1 / -1;
  }

  .intake-repeat-head {
    display: none;
  }

  .intake-actions__buttons {
    flex-direction: column;
  }

  .intake-actions .btn {
    width: 100%;
  }
}
