:root {
  --yellow: #ffc400;
  --black: #111111;
  --green: #1f6f5b;
  --green-dark: #144c3f;
  --background: #f6f8f7;
  --card: #ffffff;
  --border: #d8e0dc;
  --muted: #5f6f68;
  --error: #9f1239;
  --error-bg: #fff1f2;
  --error-border: #fecdd3;
  --info: #1e3a8a;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;
  --success: #14532d;
  --success-bg: #e9f9f1;
  --success-border: #b7efcf;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #ffffff 0%, var(--background) 100%);
  color: var(--black);
}

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

.hero {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--card);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 12px 28px rgba(17, 17, 17, 0.08);
  border-top: 8px solid var(--yellow);
}

.logo {
  width: 170px;
  max-width: 42vw;
  height: auto;
  object-fit: contain;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 5vw, 3rem);
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

form {
  display: grid;
  gap: 22px;
}

.video-list {
  display: grid;
  gap: 22px;
}

.video-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 8px;
  border-radius: 8px;
  background: #000;
  object-fit: contain;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.program-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
  padding: 18px 20px;
  border-left: 6px solid var(--yellow);
  border-radius: 8px;
  background: #111111;
  color: #fff;
}

.program-notice p {
  margin: 0;
  line-height: 1.5;
}

.program-notice-link {
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--yellow);
  color: var(--black);
  font-weight: 800;
  text-decoration: none;
}

.program-notice-link:hover,
.program-notice-link:focus {
  background: #ffe066;
}

.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  background: var(--card);
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.06);
}

legend {
  font-size: 1.3rem;
  font-weight: 800;
  padding: 0 8px;
}

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

.field.full {
  grid-column: 1 / -1;
}

label,
.question-title {
  font-weight: 700;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px 14px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}

input[readonly] {
  background: #f2f6f4;
  color: var(--green-dark);
  font-weight: 800;
}

input:focus,
select:focus {
  outline: 3px solid rgba(255, 196, 0, 0.35);
  border-color: var(--green);
}

.field-status {
  min-height: 1.2rem;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 8px;
  background: #fff8d9;
  border: 1px solid #ffe88a;
  color: #4d3a00;
}

.note.small {
  font-size: 0.92rem;
}

.question + .question {
  margin-top: 28px;
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.radio-group.stacked,
.checkbox-group {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.radio-group label,
.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  background: #fff;
  cursor: pointer;
}

.radio-group label {
  min-width: 120px;
}

.conditional {
  margin-top: 22px;
}

.eligibility-message {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 8px;
  font-weight: 700;
  line-height: 1.45;
}

.eligibility-message.success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success);
}

.eligibility-message.info {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--info);
}

.eligibility-message.error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error);
}

.section-copy {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.5;
}

.documents-copy {
  color: #222222;
}

.document-list {
  margin: 0 0 14px;
  padding-left: 22px;
  line-height: 1.5;
}

.income-people {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.income-reference-note {
  margin-top: 18px;
  font-size: 0.82rem;
}

.household-grid label {
  display: block;
  min-height: 2.4rem;
}

.income-person {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  background: #fbfdfc;
}

.income-person h3 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.income-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(180px, 0.78fr);
}

.income-grid .field {
  display: flex;
  flex-direction: column;
}

.total-field,
.declaration-grid {
  margin-top: 18px;
}

.household-total-field {
  width: calc((100% - 18px) / 2);
  margin-left: auto;
}

.household-total-message {
  width: calc((100% - 18px) / 2);
  margin-left: auto;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 12px;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  background: #fff2b0;
}

tr:last-child td {
  border-bottom: 0;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 14px 22px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

button.loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.primary {
  background: var(--green);
  color: #fff;
}

.primary:hover {
  background: var(--green-dark);
}

.secondary {
  background: #e7ece9;
}

.message {
  display: none;
  padding: 16px;
  border-radius: 8px;
}

.message.success {
  background: #e9f9f1;
  border: 1px solid #b7efcf;
  color: #14532d;
}

.message.error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error);
}

.modal-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 17, 17, 0.55);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(520px, 100%);
  border-radius: 8px;
  padding: 26px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(17, 17, 17, 0.28);
}

.modal h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.modal p {
  margin: 0 0 20px;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .income-grid {
    grid-template-columns: 1fr;
  }

  .household-grid label {
    min-height: 0;
  }

  .household-total-field {
    width: 100%;
    margin-left: 0;
  }

  .household-total-message {
    width: 100%;
    margin-left: 0;
  }

  .actions {
    flex-direction: column;
  }

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

  .program-notice-link {
    text-align: center;
  }

  button {
    width: 100%;
  }
}
