:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7f8;
  color: #17201d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: #f5f7f8;
}

button,
input,
select {
  font: inherit;
}

button,
input,
select,
.button {
  min-height: 44px;
}

input,
select {
  width: 100%;
  border: 1px solid #aebbb6;
  border-radius: 6px;
  background: #fff;
  color: #17201d;
  padding: 10px 12px;
  font-size: 16px;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid #96cabe;
  outline-offset: 2px;
}

a {
  color: #126b5a;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.25;
}

h2 {
  margin: 0 0 14px;
  font-size: 1.2rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.site-header {
  border-bottom: 1px solid #d6dfdc;
  background: #fff;
}

.header-inner {
  width: min(100% - 32px, 1040px);
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  color: #17201d;
  font-weight: 750;
  text-decoration: none;
}

.text-link {
  font-weight: 650;
  text-decoration: none;
}

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

.page.narrow,
.form-page {
  max-width: 640px;
}

.page-heading {
  margin-bottom: 24px;
}

.page-heading > p:not(.eyebrow) {
  margin: 8px 0 0;
  color: #54625d;
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 8px;
  color: #52716a;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel {
  border: 1px solid #d2dcd8;
  border-radius: 8px;
  background: #fff;
  padding: 24px;
}

.status-panel[data-state="loading"] {
  border-left: 4px solid #2e6da4;
}

.status-panel[data-state="success"] {
  border-left: 4px solid #19734f;
}

.status-panel[data-state="error"] {
  border-left: 4px solid #b83b3b;
}

.status-panel > p {
  line-height: 1.5;
}

.details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid #e1e7e4;
}

.details dt {
  color: #596761;
}

.details dd {
  margin: 0;
  font-weight: 650;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-weight: 700;
}

.field-hint,
.footnote {
  color: #5d6c66;
  font-size: 0.9rem;
  line-height: 1.5;
}

.guardian-fields {
  display: grid;
  gap: 18px;
  padding-top: 4px;
}

.button {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.button.primary {
  background: #16705d;
  color: #fff;
}

.button.secondary {
  border-color: #c8d4d0;
  background: #edf2f0;
  color: #20302b;
}

.button.compact {
  min-height: 38px;
  padding: 7px 12px;
}

.button.full {
  width: 100%;
}

.text-button {
  border: 0;
  background: transparent;
  color: #126b5a;
  font-weight: 700;
  cursor: pointer;
}

.page-actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.notice {
  margin: 20px 0;
  border-left: 4px solid #d49a20;
  background: #fff8e7;
  padding: 16px 18px;
  display: grid;
  gap: 6px;
  line-height: 1.5;
}

.form-message {
  margin: 0;
  border-radius: 6px;
  background: #fbeaea;
  color: #8d2626;
  padding: 12px 14px;
  line-height: 1.45;
}

.form-message[data-state="success"] {
  background: #e8f5ef;
  color: #145d43;
}

.success-panel p {
  line-height: 1.55;
}

.recovery-code {
  display: block;
  border: 1px dashed #83958e;
  border-radius: 6px;
  background: #f7f9f8;
  padding: 16px;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
  user-select: all;
}

.plain-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.7;
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.student-card {
  border: 1px solid #d2dcd8;
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.student-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.student-card p {
  margin: 5px 0;
  color: #52615b;
}

.hidden {
  display: none !important;
}

@media (max-width: 480px) {
  .header-inner,
  .page {
    width: min(100% - 24px, 1040px);
  }

  .page {
    padding-top: 28px;
  }

  .panel {
    padding: 20px;
  }

  .details {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .details dd {
    margin-bottom: 8px;
  }

  .page-actions {
    display: grid;
  }

  .page-actions .button {
    width: 100%;
  }
}
