/* Mobile-first auth surface based on the supplied reference.
   The form remains a real server-backed flow; this file only owns presentation. */
:root {
  --auth-blue-deep: #416b9f;
  --auth-blue: #6b9fd4;
  --auth-blue-soft: #7db3e0;
  --auth-ink: #1a1a1a;
  --auth-muted: #7d8794;
}

html.auth-page,
body.auth-page {
   min-height: 100%;
   margin: 0;
}

body.auth-page {
   min-height: 100dvh;
   overflow-x: hidden;
  background: #e9eef4;
  color: var(--auth-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.auth-reference-shell {
  width: 100%;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
}

.auth-reference-card {
  width: 100%;
  min-height: 100dvh;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.auth-reference-topline {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 22px 8px;
  color: rgba(255,255,255,.9);
  font-size: .75rem;
}

.auth-reference-brand {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  max-width: 70%;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-reference-brand-mark {
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 7px;
  background: rgba(255,255,255,.95);
  color: var(--auth-blue-deep);
}

.auth-reference-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-reference-visual {
  position: relative;
  height: 280px;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(180deg, var(--auth-blue-deep) 0%, var(--auth-blue) 42%, var(--auth-blue-soft) 100%);
}

.auth-star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  opacity: .95;
}
.auth-star:nth-child(1){top:35px;left:11%}
.auth-star:nth-child(2){top:62px;left:23%;width:2px;height:2px}
.auth-star:nth-child(3){top:25px;left:40%}
.auth-star:nth-child(4){top:72px;left:54%;width:2px;height:2px}
.auth-star:nth-child(5){top:45px;left:68%}
.auth-star:nth-child(6){top:83px;left:80%;width:2px;height:2px}
.auth-star:nth-child(7){top:30px;left:91%;width:2px;height:2px}

.auth-sun {
  position: absolute;
  top: 56px;
  left: 15%;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f5a623;
  box-shadow: 0 0 22px rgba(245,166,35,.45);
}

.auth-cloud {
  position: absolute;
  height: 18px;
  border-radius: 30px;
  background: rgba(255,255,255,.92);
}
.auth-cloud::before,
.auth-cloud::after {
  content: "";
  position: absolute;
  bottom: 5px;
  border-radius: 50%;
  background: inherit;
}
.auth-cloud::before {left: 14px;width:28px;height:28px}
.auth-cloud::after {right: 8px;width:21px;height:21px}
.auth-cloud.one {top:108px;left:8%;width:78px}
.auth-cloud.two {top:88px;right:19%;width:56px;height:14px;opacity:.72}

.auth-plane {
  position: absolute;
  top: 62px;
  left: 45%;
  width: 42px;
  height: 23px;
  transform: rotate(-5deg);
}
.auth-plane::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0 45%,100% 0,63% 100%,45% 57%);
  background: rgba(255,255,255,.9);
}

.auth-planet {
  position: absolute;
  top: 45px;
  right: 9%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg,#a17fba,#7155a1);
}
.auth-planet::after {
  content: "";
  position: absolute;
  width: 55px;
  height: 14px;
  top: 10px;
  left: -11px;
  border: 2px solid #c4a8d4;
  border-radius: 50%;
  transform: rotate(-20deg);
}

.auth-pencil-scene {
  position: absolute;
  bottom: 22px;
  left: 50%;
  width: 220px;
  height: 82px;
  transform: translateX(-50%);
}
.auth-pencil {
  position: absolute;
  left: 22px;
  right: 4px;
  bottom: 10px;
  height: 30px;
  border-radius: 4px;
  transform: rotate(-5deg);
  background: linear-gradient(#f5d742,#d4b520);
  box-shadow: inset 0 8px rgba(255,255,255,.18), inset 0 -8px rgba(0,0,0,.08);
}
.auth-pencil::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 0;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  border-right: 28px solid #f5d742;
}
.auth-pencil::after {
  content: "";
  position: absolute;
  left: -25px;
  top: 11px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-right: 10px solid #333;
}
.auth-student {
  position: absolute;
  z-index: 2;
  left: 24px;
  bottom: 37px;
  width: 30px;
  height: 46px;
}
.auth-student::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f4c4a0;
  box-shadow: inset 0 7px #d4783a;
}
.auth-student::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 28px;
  width: 24px;
  height: 20px;
  border-radius: 4px;
  background: #fff;
  box-shadow: -5px 20px #4a6fa5, 5px 20px #4a6fa5;
}

.auth-reference-content {
  position: relative;
  z-index: 5;
  flex: 1;
  min-height: 0;
  margin-top: -22px;
  padding: 24px 24px max(18px, env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: #fff;
}

.auth-reference-content h1 {
  margin: 0 0 6px;
  color: var(--auth-ink);
  font-size: 1.75rem;
  line-height: 1.15;
  font-weight: 750;
}

.auth-reference-subtitle {
  margin: 0 0 20px;
  color: #888;
  font-size: .95rem;
}

.auth-field { margin-bottom: 16px; }
.auth-field label {
  display: block;
  margin-bottom: 6px;
  color: #9ba3ad;
  font-size: .75rem;
}
.auth-field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1.5px solid #e0e0e0;
  outline: 0;
  background: transparent;
  color: #333;
  font: inherit;
  font-size: .96rem;
}
.auth-field input:focus { border-bottom-color: var(--auth-blue); }
.auth-password { position: relative; }
.auth-password input { padding-right: 44px; }
.auth-password button {
  position: absolute;
  right: 0;
  top: 50%;
  min-width: 40px;
  min-height: 40px;
  padding: 6px;
  border: 0;
  background: transparent;
  color: #b5bcc4;
  cursor: pointer;
  transform: translateY(-50%);
}

.auth-submit {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  margin-top: 10px;
  padding: 14px 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg,#5b8ec4,#4a7ab5);
  color: #fff;
  font: inherit;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, opacity .2s;
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(74,122,181,.35); }
.auth-submit:disabled { cursor: wait; opacity: .7; transform: none; }

.auth-biometric {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 24px 0 12px;
}
.auth-biometric button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 92px;
  min-height: 68px;
  padding: 9px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #666;
  cursor: pointer;
  font: inherit;
  font-size: .7rem;
}
.auth-biometric button:hover,
.auth-biometric button:active {
  background: transparent;
  color: #666;
}
.auth-biometric button:hover i,
.auth-biometric button:active i { color: #666; }
.auth-biometric i { color: #666; font-size: 2rem; }

.auth-link {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  margin-top: 4px;
  color: #78818a;
  font-size: .86rem;
  text-decoration: none;
}
.auth-link:hover { color: var(--auth-blue-deep); }
.auth-inline-link {
  color: var(--auth-blue-deep);
  font-weight: 650;
  text-decoration: none;
}
.auth-inline-link:hover { text-decoration: underline; }

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin-bottom: 1rem;
  padding: .7rem .8rem;
  border-radius: 10px;
  font-size: .8rem;
  line-height: 1.45;
}
.auth-alert.error { color: #991b1b; background: #fef2f2; border: 1px solid #fecaca; }
.auth-alert.success { color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; }
.auth-alert.info { color: #1e40af; background: #eff6ff; border: 1px solid #bfdbfe; }
.auth-message {
  margin: .6rem 0;
  color: #66717e;
  font-size: .8rem;
  line-height: 1.5;
  text-align: center;
}
.auth-message.error { color: #b91c1c; }
.auth-message.success { color: #166534; }

.auth-otp {
  width: 100%;
  padding: 12px 8px;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  outline: 0;
  color: #1a1a1a;
  font: inherit;
  font-size: 1.6rem;
  font-weight: 750;
  letter-spacing: .4em;
  text-align: center;
}
.auth-otp:focus { border-color: var(--auth-blue); box-shadow: 0 0 0 3px rgba(74,122,181,.12); }

.auth-resend {
  display: block;
  margin: 14px auto 0;
  border: 0;
  background: transparent;
  color: var(--auth-blue-deep);
  cursor: pointer;
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
}

.auth-home-indicator {
  width: 134px;
  height: 5px;
  margin: 18px auto 0;
  border-radius: 3px;
  background: #ddd;
}

.auth-contact {
  margin-top: 18px;
  padding: .85rem 1rem;
  border-radius: 12px;
  background: #f0f4fb;
  color: #475569;
  font-size: .78rem;
  line-height: 1.7;
}
.auth-contact strong { display: block; color: #1f2937; }
.auth-contact a { color: var(--auth-blue-deep); text-decoration: none; }

.auth-reference-info,
.auth-install-dock { display: none; }

/* The login screen keeps its original authentication controls, but does not
   display the PWA install button. The install link can still invoke the
   browser prompt if a user explicitly chooses it. */
.auth-login-page #pwaInstallBtn,
.auth-login-page .auth-install-dock { display: none !important; }

.auth-forgot-page #pwaInstallBtn,
.auth-forgot-page .auth-install-dock { display: none !important; }

@media (min-width: 700px) {
  html.auth-page,
  body.auth-page {
    overflow: hidden;
  }
  body.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
  }
  .auth-reference-shell {
    min-height: 0;
    max-width: 1080px;
    min-height: min(700px, calc(100dvh - 64px));
    align-items: stretch;
  }
  .auth-reference-card {
    max-width: none;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin: 0;
    border-radius: 24px;
    box-shadow: 0 0 40px rgba(30,58,138,.12);
  }
  .auth-reference-content {
    grid-column: 1;
    grid-row: 1;
    order: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
    padding: 56px clamp(38px, 6vw, 76px);
    border-radius: 24px 0 0 24px;
  }
  .auth-reference-content h1 { font-size: clamp(2rem, 3vw, 2.65rem); }
  .auth-reference-subtitle { margin-bottom: 30px; }
  .auth-reference-visual {
    grid-column: 2;
    grid-row: 1;
    order: 2;
    height: auto;
    min-height: 100%;
    border-radius: 0 24px 24px 0;
  }
  .auth-reference-info {
    position: absolute;
    z-index: 3;
    display: block;
    left: clamp(30px, 5vw, 70px);
    right: clamp(30px, 5vw, 70px);
    bottom: 128px;
    max-width: 390px;
    padding: 20px 22px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 18px;
    background: rgba(17, 46, 82, .34);
    color: #fff;
    backdrop-filter: blur(6px);
  }
  .auth-reference-info-kicker {
    margin-bottom: 7px;
    color: rgba(255,255,255,.75);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .14em;
  }
  .auth-reference-info h2 {
    margin: 0 0 8px;
    font-size: clamp(1.25rem, 2.2vw, 1.8rem);
    line-height: 1.15;
  }
  .auth-reference-info p {
    margin: 0 0 10px;
    color: rgba(255,255,255,.82);
    font-size: .8rem;
    line-height: 1.5;
  }
  .auth-reference-info ul {
    display: grid;
    gap: 5px;
    margin: 0 0 13px;
    padding: 0;
    list-style: none;
    color: rgba(255,255,255,.9);
    font-size: .76rem;
  }
  .auth-reference-info li { display: flex; gap: 7px; align-items: center; }
  .auth-reference-info li i { color: #b9e2ff; }
  .auth-mobile-app-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #fff;
    font-size: .78rem;
    font-weight: 750;
    text-decoration: none;
  }
  .auth-mobile-app-link:hover { color: #e0f2fe; text-decoration: underline; }
  .auth-install-dock {
    position: fixed;
    z-index: 99990;
    top: 16px;
    left: 16px;
    right: auto;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .auth-install-dock #pwaInstallBtn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 9px 13px;
    border: 0;
     border-radius: 999px;
    background: rgba(255,255,255,.95);
    color: var(--auth-blue-deep);
    box-shadow: 0 5px 18px rgba(11,42,78,.28);
    cursor: pointer;
    font: inherit;
    font-size: .74rem;
    font-weight: 800;
  }
  /* Keep device sign-in available on desktop as well as mobile. */
  .auth-reference-content > .auth-link { margin-top: 22px; }
  .auth-home-indicator { display: none; }
}

@media (min-width: 700px) and (max-height: 760px) {
  .auth-reference-content { padding-top: 34px; padding-bottom: 34px; }
  .auth-reference-subtitle { margin-bottom: 20px; }
}

@media (max-height: 700px) {
  .auth-reference-visual { height: 220px; }
  .auth-reference-content { padding-top: 20px; }
  .auth-biometric { margin-top: 16px; }
}

@media (max-width: 360px) {
  .auth-reference-content { padding-left: 18px; padding-right: 18px; }
  .auth-reference-topline { padding-left: 16px; padding-right: 16px; }
  .auth-biometric { gap: 10px; }
}

@media (max-width: 699px) {
  html.auth-page,
  body.auth-page { height: 100%; overflow: hidden; }
  .auth-reference-card { height: 100dvh; min-height: 0; }
  .auth-reference-content { overflow: hidden; }
  .auth-school-name { display: none; }
  .auth-reference-info,
  .auth-install-dock { display: none !important; }
  .auth-forgot-page .auth-reference-content {
    display: flex;
    flex-direction: column;
  }
  .auth-forgot-page .auth-reference-content > .auth-link {
    margin-top: auto;
  }
  .auth-login-page .auth-reference-content {
    display: flex;
    flex-direction: column;
  }
  .auth-login-page .auth-reference-content > .auth-link {
    margin-top: auto;
  }
}

@media (max-width: 699px) and (max-height: 760px) {
  .auth-reference-visual { height: 218px; }
  .auth-reference-content { padding: 18px 24px 10px; }
  .auth-reference-content h1 { font-size: 1.5rem; margin-bottom: 4px; }
  .auth-reference-subtitle { margin-bottom: 12px; font-size: .84rem; }
  .auth-field { margin-bottom: 9px; }
  .auth-field input { min-height: 39px; padding: 7px 0; font-size: .88rem; }
  .auth-submit { min-height: 45px; margin-top: 5px; padding: 10px 14px; }
  .auth-biometric { gap: 8px; margin: 13px 0 4px; }
  .auth-biometric button { min-height: 52px; padding: 4px; }
  .auth-biometric i { font-size: 1.6rem; }
  .auth-contact { margin-top: 9px; padding: .55rem .7rem; font-size: .7rem; }
  .auth-home-indicator { margin-top: 8px; }
}