:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #667085;
  --line: #d8dee8;
  --surface: #ffffff;
  --soft: #f5f7fa;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --accent: #9a3412;
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: #edf2f6;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

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

.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: 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: #ffffff;
  background: var(--brand);
  font-weight: 800;
}

.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;
}

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

.intro {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.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);
}

.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);
  transition: width 180ms ease;
}

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

.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 {
  align-items: start;
  margin-bottom: 14px;
}

.subsection {
  padding: 18px;
}

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

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

.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(15, 118, 110, 0.16);
  border-color: var(--brand);
}

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 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;
}

.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);
}

.submit-button:hover {
  background: var(--brand-strong);
}

.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) {
  .form-grid,
  .guardian-grid,
  .form-grid.compact,
  .checkbox-field {
    grid-template-columns: 1fr;
  }

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

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