:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --ink: #17202c;
  --ink-soft: #434d5b;
  --muted: #5e6875;
  --border: #dbe3ec;
  --brand: #0d59a9;
  --brand-dark: #044487;
  --brand-action: #2a72c7;
  --danger: #b42318;
  --success: #067647;
  --shadow: 0 18px 48px rgba(16, 32, 48, 0.12);
  --duration-fast: 250ms;
  --duration-medium: 350ms;
  --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.entry-shell {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 56px 24px;
  overflow: hidden;
  background: var(--bg);
}

.privacy-note {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.form-panel {
  width: min(100%, 720px);
}

.form-card {
  width: 100%;
  text-align: center;
  transition:
    opacity var(--duration-fast) var(--ease-smooth-out),
    transform var(--duration-fast) var(--ease-smooth-out);
}

.entry-shell.is-connecting .form-card {
  opacity: 0;
  transform: translateY(10px) scale(.985);
}

.entry-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 44px;
}

.entry-brand img {
  display: block;
  width: 210px;
  max-width: 68vw;
  height: auto;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brand-action);
  font-size: 14px;
  font-weight: 800;
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: 46px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.14;
}

.summary {
  margin: 16px auto 34px;
  max-width: 520px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.school-form {
  width: min(100%, 680px);
  margin: 0 auto;
}

label {
  display: block;
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
  text-align: left;
}

.code-search {
  display: flex;
  align-items: center;
  min-height: 72px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 16px 42px rgba(16, 32, 48, .1);
}

.code-search:focus-within {
  border-color: rgba(42, 114, 199, .68);
  outline: 4px solid rgba(42, 114, 199, .16);
  outline-offset: 3px;
}

input,
button,
.link-button {
  min-height: 56px;
  border-radius: 8px;
  font: inherit;
}

input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0 8px 0 24px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

input::placeholder {
  color: #9aa7b5;
}

button:focus,
.link-button:focus {
  outline: 4px solid rgba(42, 114, 199, .18);
  outline-offset: 2px;
}

input:focus {
  outline: 0;
}

button,
.link-button {
  border: 0;
  background: var(--brand-action);
  color: #ffffff;
  padding: 0 20px;
  font-weight: 800;
  cursor: pointer;
}

button:hover,
.link-button:hover {
  background: var(--brand);
}

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

.school-form button {
  flex: 0 0 auto;
  min-width: 142px;
  margin: 6px;
  border-radius: 999px;
}

.status {
  margin: 18px 0 0;
  min-height: 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.status.error { color: var(--danger); }
.status.success { color: var(--success); }

.result {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  background: #f8fbfd;
}

.result strong,
.result span {
  display: block;
}

.result span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

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

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.link-button.secondary {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
}

.link-button.secondary:hover {
  background: #eef4f8;
}

.connecting-view {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, .22), transparent 34%),
    linear-gradient(135deg, #044487 0%, #2a72c7 55%, #65a1ec 100%);
  color: #ffffff;
  opacity: 0;
  padding: 32px;
  transform: scale(.985);
  transition:
    opacity var(--duration-fast) var(--ease-smooth-out) 80ms,
    transform var(--duration-fast) var(--ease-smooth-out) 80ms;
}

.entry-shell.is-connecting .connecting-view {
  opacity: 1;
  transform: scale(1);
}

.connecting-content {
  display: grid;
  justify-items: center;
  width: min(100%, 520px);
  text-align: center;
}

.connecting-logo {
  display: block;
  width: min(270px, 74vw);
  height: auto;
}

.connecting-spinner {
  width: 34px;
  height: 34px;
  margin-top: 44px;
  border: 3px solid rgba(255, 255, 255, .32);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: connect-spin 850ms linear infinite;
}

.connecting-eyebrow {
  margin: 24px 0 0;
  color: rgba(255, 255, 255, .78);
  font-size: 14px;
  font-weight: 800;
}

.connecting-school {
  margin: 10px 0 0;
  max-width: 100%;
  color: #ffffff;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.08;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.connecting-route {
  margin: 16px 0 0;
  color: rgba(255, 255, 255, .84);
  font-size: 16px;
  line-height: 1.6;
}

.connecting-view .actions {
  justify-content: center;
  margin-top: 34px;
}

.connecting-view .link-button {
  min-width: 168px;
  background: #ffffff;
  color: #044487;
  box-shadow: 0 14px 34px rgba(3, 31, 65, .22);
}

.connecting-view .link-button:hover {
  background: #f2f8ff;
}

.connecting-view .link-button.secondary {
  border-color: rgba(255, 255, 255, .46);
  background: rgba(255, 255, 255, .12);
  color: #ffffff;
  box-shadow: none;
}

.connecting-view .link-button.secondary:hover {
  background: rgba(255, 255, 255, .2);
}

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

@media (prefers-reduced-motion: reduce) {
  .form-card,
  .connecting-view {
    transition: none;
  }

  .entry-shell.is-connecting .form-card,
  .connecting-view {
    transform: none;
  }

  .connecting-spinner {
    animation: none;
  }
}

@media (max-width: 900px) {
  .entry-shell {
    padding: 42px 22px;
  }

  h2 {
    font-size: 40px;
  }

  .summary {
    margin-bottom: 30px;
  }
}

@media (max-width: 520px) {
  .entry-shell {
    padding: 32px 18px;
  }

  .entry-brand {
    margin-bottom: 34px;
  }

  .entry-brand img {
    width: 188px;
  }

  h2 {
    font-size: 35px;
  }

  .summary {
    font-size: 16px;
  }

  .code-search {
    display: block;
    min-height: 0;
    border-radius: 24px;
    padding: 6px;
  }

  input {
    min-height: 58px;
    padding: 0 16px;
    text-align: center;
    font-size: 19px;
  }

  .school-form button {
    width: 100%;
    margin: 0;
  }
}
