:root {
  --navy-950: #07162e;
  --navy-900: #0b2142;
  --navy-800: #12325d;
  --gold-500: #c8a34b;
  --gold-300: #e3ca83;
  --white: #ffffff;
  --paper: #f6f8fb;
  --ink: #132238;
  --muted: #647187;
  --line: #dce2ea;
  --danger: #9f2f35;
  --danger-bg: #fff3f3;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
  min-height: 100vh;
}

.school-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 4.75rem);
  color: var(--white);
  background: linear-gradient(145deg, var(--navy-950), var(--navy-800));
}

.school-panel::after {
  position: absolute;
  right: -9rem;
  bottom: -11rem;
  width: 30rem;
  height: 30rem;
  border: 1px solid rgba(227, 202, 131, .16);
  border-radius: 50%;
  box-shadow: 0 0 0 4rem rgba(255, 255, 255, .018), 0 0 0 8rem rgba(255, 255, 255, .012);
  content: "";
}

.school-identity {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1.15rem;
  max-width: 46rem;
}

.school-logo-frame {
  display: grid;
  flex: 0 0 auto;
  width: 5.5rem;
  height: 5.5rem;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(227, 202, 131, .65);
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .24);
}

.school-logo { width: 100%; height: 100%; object-fit: contain; }
.school-monogram { color: var(--navy-900); font-size: 1.5rem; font-weight: 800; }

.eyebrow, .access-label, .welcome-kicker {
  margin: 0;
  color: var(--gold-300);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.school-identity h1 {
  max-width: 38rem;
  margin: .42rem 0 .3rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2.25vw, 2rem);
  line-height: 1.18;
  letter-spacing: .025em;
}

.school-place { margin: 0; color: #d5dfed; font-size: .88rem; letter-spacing: .08em; }

.academic-mark { display: flex; gap: .45rem; margin: clamp(3rem, 10vh, 7rem) 0 1.5rem; }
.academic-mark span { width: 2.7rem; height: 2px; background: var(--gold-500); }
.academic-mark span:nth-child(2) { width: 1.2rem; opacity: .65; }
.academic-mark span:nth-child(3) { width: .45rem; opacity: .35; }

.welcome-copy { position: relative; z-index: 1; max-width: 37rem; }
.welcome-copy h2 {
  margin: .75rem 0 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4.6vw, 3.75rem);
  font-weight: 600;
  line-height: 1.08;
}
.welcome-copy > p:last-child { max-width: 34rem; margin: 0; color: #c8d5e6; font-size: 1rem; line-height: 1.7; }
.security-note { position: relative; z-index: 1; margin: auto 0 0; padding-top: 3rem; color: #9eb0c9; font-size: .78rem; }

.form-panel { display: grid; min-height: 100%; padding: clamp(1.5rem, 5vw, 4.5rem); place-items: center; background: var(--paper); }
.login-card { width: min(100%, 27rem); }
.access-label { color: #8a681f; }
.login-card h2 { margin: .65rem 0 .6rem; color: var(--navy-900); font-size: clamp(1.7rem, 3vw, 2.2rem); line-height: 1.2; }
.form-intro { margin: 0 0 2rem; color: var(--muted); }

.login-error { margin-bottom: 1.35rem; padding: .8rem 1rem; border: 1px solid #ebc6c8; border-radius: .55rem; color: var(--danger); background: var(--danger-bg); font-size: .9rem; }
.login-error p { margin: 0; }
.login-error p + p { margin-top: .35rem; }

.field-group { margin-bottom: 1.2rem; }
.field-group label { display: inline-block; margin-bottom: .45rem; color: #2c3d53; font-size: .86rem; font-weight: 650; }
.field-group input {
  width: 100%;
  min-height: 3.15rem;
  padding: .72rem .85rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  outline: none;
  color: var(--ink);
  background: var(--white);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.field-group input:focus { border-color: var(--navy-800); box-shadow: 0 0 0 3px rgba(18, 50, 93, .12); }

.password-field { position: relative; }
.password-field input { padding-right: 4.5rem; }
.password-toggle { position: absolute; top: 50%; right: .55rem; min-width: 3.2rem; padding: .35rem .45rem; transform: translateY(-50%); border: 0; border-radius: .3rem; color: var(--navy-800); background: transparent; cursor: pointer; font-size: .8rem; font-weight: 700; }
.password-toggle:hover { background: #eef2f7; }
.password-toggle:focus-visible, .sign-in-button:focus-visible { outline: 3px solid var(--gold-300); outline-offset: 2px; }

.sign-in-button { display: inline-flex; width: 100%; min-height: 3.2rem; align-items: center; justify-content: center; gap: .65rem; margin-top: .25rem; border: 1px solid var(--navy-900); border-radius: .5rem; color: var(--white); background: var(--navy-900); cursor: pointer; font-weight: 700; transition: background .16s ease, transform .16s ease; }
.sign-in-button:hover { background: var(--navy-800); }
.sign-in-button:active { transform: translateY(1px); }
.sign-in-button:disabled { cursor: wait; opacity: .76; }
.button-progress { display: none; width: 1rem; height: 1rem; border: 2px solid rgba(255, 255, 255, .38); border-top-color: var(--white); border-radius: 50%; animation: spin .75s linear infinite; }
.sign-in-button.is-loading .button-progress { display: block; }
.submit-status { min-height: 1.2rem; margin: .45rem 0 0; color: var(--muted); font-size: .78rem; text-align: center; }
.support-note { margin: 1.8rem 0 0; padding-top: 1.35rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .83rem; line-height: 1.55; text-align: center; }

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

@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .school-panel { min-height: auto; padding: 1.5rem; }
  .school-logo-frame { width: 4.25rem; height: 4.25rem; }
  .eyebrow { display: none; }
  .academic-mark, .welcome-copy, .security-note { display: none; }
  .form-panel { min-height: auto; padding: 2.5rem 1.25rem; }
}

@media (max-width: 480px) {
  .school-identity { align-items: flex-start; gap: .8rem; }
  .school-logo-frame { width: 3.65rem; height: 3.65rem; }
  .school-identity h1 { margin-top: 0; font-size: 1rem; }
  .school-place { font-size: .72rem; }
  .form-panel { place-items: start center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
