:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --surface: #ffffff;
  --surface-muted: #f8faf7;
  --text: #1f2a26;
  --muted: #68736f;
  --line: #dce3de;
  --line-strong: #bbc8c1;
  --brand: #3f7168;
  --brand-dark: #2f5a53;
  --brand-soft: #eaf3ef;
  --warning-bg: #fff8e6;
  --warning-line: #d6ac4b;
  --error: #9d2f2f;
  --success: #267044;
  --shadow: 0 18px 50px rgba(35, 48, 43, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(63, 113, 104, 0.13), transparent 34rem),
    linear-gradient(180deg, #fbfcfa 0%, var(--bg) 46rem);
  font-family: "Aptos", "Segoe UI", Calibri, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.top-band {
  height: 8px;
  background: linear-gradient(90deg, #3f7168, #9b8a66, #d8b75d);
}

.page {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.intro {
  margin-bottom: 24px;
}

.intro-panel {
  padding: 36px;
  border: 1px solid rgba(220, 227, 222, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.logo {
  display: block;
  width: min(250px, 70vw);
  height: auto;
  margin: 0 0 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 12px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0 0 14px;
  color: #1c2723;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.15rem, 4vw, 3.4rem);
  font-weight: 700;
  line-height: 1.05;
}

.intro p {
  max-width: 780px;
  margin: 0 0 12px;
  color: var(--muted);
}

.intro p:last-child {
  margin-bottom: 0;
}

.notice {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #ead7a5;
  border-left: 5px solid var(--warning-line);
  border-radius: 8px;
  color: #3a3122;
  background: var(--warning-bg);
  font-weight: 700;
}

.messages {
  margin-bottom: 18px;
}

.message {
  margin: 0 0 10px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.message.error {
  border-color: #dfb8b8;
  color: var(--error);
}

.message.success {
  border-color: #adcfba;
  color: var(--success);
}

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

fieldset {
  margin: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(35, 48, 43, 0.05);
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading .eyebrow {
  margin-bottom: 10px;
}

legend {
  display: block;
  padding: 0;
  color: #1c2723;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.28rem;
  font-weight: 700;
}

.grid {
  display: grid;
  gap: 18px;
  align-items: start;
}

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

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

label {
  display: block;
  margin: 0 0 18px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 750;
}

.grid > label {
  margin-bottom: 0;
}

span {
  color: var(--brand-dark);
  font-weight: 800;
}

small,
.description {
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 400;
  line-height: 1.35;
}

small {
  display: block;
  margin-top: 7px;
}

.description {
  margin: 0 0 18px;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  margin-top: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
  font: inherit;
  font-weight: 400;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input,
select {
  height: 46px;
}

select {
  cursor: pointer;
}

textarea {
  min-height: 124px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  outline: 4px solid rgba(63, 113, 104, 0.16);
}

.question {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid #e3e9e5;
  border-radius: 8px;
  background: var(--surface-muted);
}

.question p {
  margin: 0 0 2px;
  color: var(--text);
  font-weight: 800;
}

.question label {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid #e7ece8;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 400;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.question label:hover {
  border-color: rgba(63, 113, 104, 0.45);
  background: var(--brand-soft);
}

input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 3px 0 0;
  accent-color: var(--brand);
  flex: 0 0 auto;
}

.conditional-section {
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid #e3e9e5;
  border-radius: 8px;
  background: var(--surface-muted);
}

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

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

.conditional-policy-holder-section[hidden] {
  display: none;
}

.conditional-section .description {
  margin-bottom: 16px;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 4px;
}

.actions p {
  margin: 0;
  color: var(--muted);
}

button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  padding: 0 24px;
  color: #fff;
  background: var(--brand);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(63, 113, 104, 0.22);
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

button:hover {
  background: var(--brand-dark);
  box-shadow: 0 12px 22px rgba(63, 113, 104, 0.26);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

@media (min-width: 761px) {
  .grid.two,
  .grid.three {
    grid-auto-rows: 1fr;
  }

  .grid.two > label,
  .grid.three > label {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 24px, 960px);
    padding: 24px 0 38px;
  }

  .intro-panel,
  fieldset {
    padding: 22px 18px;
  }

  .logo {
    width: min(225px, 78vw);
  }

  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .question,
  .conditional-section {
    padding: 13px;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}

.admin-body {
  background: var(--bg);
}

.admin-page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 64px;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.admin-header h1 {
  margin-bottom: 8px;
}

.admin-header p {
  margin: 0;
  color: var(--muted);
}

.admin-logo {
  display: block;
  width: min(230px, 64vw);
  height: auto;
  margin: 0 0 22px;
}

.admin-card {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(35, 48, 43, 0.05);
}

.admin-card h2 {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
}

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

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-table span,
.detail-list span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 400;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--brand-dark);
  font-weight: 800;
  text-decoration: none;
}

.admin-link:hover {
  text-decoration: underline;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.status-pill.success {
  color: var(--success);
  background: #e9f5ee;
}

.status-pill.error {
  color: var(--error);
  background: #faeeee;
}

.status-pill.neutral {
  color: var(--muted);
  background: #eef1ef;
}

.detail-list {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 10px 16px;
  margin: 0 0 18px;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
}

.json-block {
  max-height: 520px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8f6;
  color: #1f2a26;
  font-size: 0.84rem;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .admin-page {
    width: min(100% - 24px, 1180px);
    padding: 24px 0 38px;
  }

  .admin-header,
  .admin-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }
}
