:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #667085;
  --line: #d8dee8;
  --surface: #ffffff;
  --soft: #f5f7fa;
  --brand: #001d4c;
  --brand-strong: #002b6d;
  --brand-secondary: #1baaa0;
  --brand-navy: #001d4c;
  --brand-warm: #fcb900;
  --accent: #1baaa0;
  --shadow: 0 18px 50px rgba(0, 29, 76, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(0, 29, 76, 0.06), rgba(255, 255, 255, 0) 260px),
    #f4f7fb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  transform: translateY(-160%);
  background: #ffffff;
  color: #111827;
  border: 2px solid var(--accent);
  padding: 10px 14px;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

button,
input,
select,
textarea {
  font: inherit;
}

.upload-field span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.form-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.97), rgba(239, 251, 250, 0.94)),
    rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: var(--brand-navy);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(0, 29, 76, 0.12);
  font-weight: 800;
}

.brand-logo {
  overflow: hidden;
  background: #ffffff;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-row strong,
.brand-row span {
  display: block;
}

.brand-row span {
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-link {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 12px;
  color: var(--ink);
  background: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.admin-link:hover {
  border-color: rgba(27, 170, 160, 0.48);
  color: var(--brand-navy);
  background: #f3fbfa;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

main {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 34px 0 60px;
}

.public-form-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  align-items: start;
  gap: 28px;
  width: min(1220px, calc(100% - 28px));
}

.public-form-content {
  min-width: 0;
}

.public-brand-rail {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 360px;
  padding: 22px;
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(241, 250, 250, 0.94)),
    #ffffff;
  border: 1px solid rgba(0, 29, 76, 0.14);
  box-shadow: var(--shadow);
}

.public-brand-rail::after {
  content: "";
  align-self: end;
  height: 5px;
  width: 86px;
  border-radius: 999px;
  background: var(--brand-warm);
}

.public-brand-logo {
  display: block;
  width: min(190px, 100%);
  height: auto;
  margin-bottom: 4px;
}

.public-brand-rail p {
  margin: 0;
  color: #475467;
  font-size: 0.94rem;
}

.public-brand-rail a {
  color: var(--brand-secondary);
  font-weight: 900;
  text-decoration: none;
}

.public-brand-rail a:hover {
  text-decoration: underline;
}

.embedded-form {
  background: #ffffff;
}

.embedded-form .form-header,
.embedded-form .intro,
.embedded-form .public-brand-rail {
  display: none;
}

.embedded-form main {
  width: min(100%, 1040px);
  padding: 18px;
}

.embedded-form .public-form-layout {
  display: block;
}

.embedded-form .application-form {
  margin-top: 0;
}

.compact-public-form {
  max-width: 860px;
  margin-inline: auto;
}

.intro {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(239, 251, 250, 0.94) 58%, rgba(255, 249, 229, 0.86)),
    #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.eyebrow {
  margin: 0;
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.25rem;
  line-height: 1.2;
}

h3 {
  margin-bottom: 14px;
  font-size: 1rem;
}

.intro p:last-child,
.section-title p,
.notice p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
}

.public-step-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

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

.public-step-bar li {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 30px;
  padding: 7px 10px;
  border: 1px solid rgba(0, 29, 76, 0.16);
  border-radius: 8px;
  color: var(--brand-navy);
  background: #ffffff;
  font-size: 0.8rem;
  font-weight: 900;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.public-step-bar li.active {
  border-color: var(--brand-secondary);
  color: #ffffff;
  background: var(--brand);
}

.public-step-bar span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #ffffff;
  background: var(--brand-secondary);
  font-size: 0.74rem;
}

.application-form {
  display: grid;
  gap: 18px;
}

.form-progress {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #ffffff;
}

.form-progress > span {
  color: var(--brand-strong);
  font-weight: 900;
}

.progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe3eb;
}

.progress-track span {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-secondary);
  transition: width 180ms ease;
}

.form-page[hidden] {
  display: none;
}

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

.form-section,
.subsection {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.form-section {
  padding: clamp(18px, 3vw, 28px);
}

.section-title {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}

.section-title > span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #ffffff;
  background: var(--brand);
  font-weight: 900;
}

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

.guardian-grid {
  grid-template-columns: 1fr;
  align-items: start;
  margin-bottom: 14px;
}

.subsection {
  padding: 18px;
}

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

.subsection > h3 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 0.86rem;
  font-weight: 800;
}

.field-help {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  color: var(--ink);
  background: #ffffff;
}

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

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(27, 170, 160, 0.18);
  border-color: var(--brand-secondary);
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.success-message {
  border: 1px solid rgba(27, 170, 160, 0.3);
  border-radius: 8px;
  padding: 12px;
  color: #0f5f59;
  background: #effaf7;
  font-weight: 800;
}

.review-summary {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(27, 170, 160, 0.35);
  border-left: 5px solid var(--brand-secondary);
  border-radius: 8px;
  background: #f7fbfa;
}

.review-summary p {
  margin: 4px 0 0;
  color: var(--muted);
}

.review-summary dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 0;
}

.review-summary dl div {
  padding-top: 8px;
  border-top: 1px solid rgba(27, 170, 160, 0.2);
}

.review-summary dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.review-summary dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

fieldset {
  min-width: 0;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 10px;
  color: #344054;
  font-weight: 900;
}

.checkbox-field {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px 16px;
}

.checkbox-field legend {
  grid-column: 1 / -1;
}

.checkbox-field label,
.consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-weight: 700;
}

.checkbox-field.single-column,
.checkbox-field.compact-options {
  grid-template-columns: 1fr;
}

.table-form {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 8px;
}

.table-form span {
  color: #344054;
  font-size: 0.8rem;
  font-weight: 900;
}

.checkbox-field input,
.consent input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 2px;
}

.notice {
  margin-bottom: 16px;
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  padding: 14px 16px;
  background: #fff7ed;
}

.error-summary {
  border-color: #f1a4a0;
  color: #7a271a;
  background: #fff1f0;
}

.notice strong {
  display: block;
  margin-bottom: 4px;
}

.consent {
  margin-top: 16px;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.submit-button,
.secondary-button {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  padding: 11px 16px;
  font-weight: 900;
  cursor: pointer;
}

.submit-button {
  color: #ffffff;
  background: var(--brand-secondary);
}

.submit-button:hover {
  filter: brightness(0.88);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
}

.secondary-button:hover {
  background: var(--soft);
}

.secondary-button[hidden],
.submit-button[hidden] {
  display: none;
}

#formStatus {
  margin: 0;
  color: var(--brand-strong);
  font-weight: 800;
}

@media (max-width: 860px) {
  .public-form-layout {
    grid-template-columns: 1fr;
  }

  .public-brand-rail {
    position: static;
    min-height: 0;
  }

  .public-step-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }

  .public-step-bar li {
    min-width: max-content;
    min-height: 38px;
    flex: 0 0 auto;
    padding: 7px 12px;
    scroll-snap-align: center;
  }

  .form-grid,
  .guardian-grid,
  .form-grid.compact,
  .checkbox-field,
  .table-form {
    grid-template-columns: 1fr;
  }

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

  .form-section {
    padding: 16px;
  }

  .subsection {
    padding: 14px;
  }

  .review-summary dl {
    grid-template-columns: 1fr;
  }

  .admin-link,
  .submit-button,
  .secondary-button {
    text-align: center;
  }
}
