/**
 * Auth Vision shell — shared by parent login/signup/forgot/reset + student login.
 * Full-width glass navbar + frosted auth card (Apple Vision material).
 */

/* ---- Page shell ---- */
.page--auth-vision {
  width: 100%;
  max-width: none;
  margin: 0;
  /* 勿用 padding:0 抹掉固定顶栏 clearance（由 design-system 设置 padding-top） */
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 100vh;
}

.auth-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  /* 顶栏避让由 .page 的 --ds-navbar-clearance 负责，此处不再重复加顶栏高度 */
  min-height: calc(100dvh - var(--ds-navbar-clearance, 96px));
  padding: 20px 16px;
}

/* ---- Frosted Vision card (unified) ---- */
.auth-card {
  width: min(400px, 100%);
  margin: 0 auto;
  padding: 22px 22px 18px;
  box-sizing: border-box;
  border-radius: 22px;
  background: rgba(255, 252, 248, 0.26);
  background-image: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(255, 255, 255, 0.14) 48%,
    rgba(255, 250, 245, 0.1) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 18px 48px rgba(32, 22, 14, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
  -webkit-backdrop-filter: blur(32px) saturate(1.65) brightness(1.08);
  backdrop-filter: blur(32px) saturate(1.65) brightness(1.08);
  color: #2b211c;
  text-align: left;
}

.auth-card__title {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #2b211c;
  text-align: center;
}

.auth-card__lead {
  margin: 0 0 14px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: rgba(43, 33, 28, 0.72);
  text-align: center;
}

/* Signup: denser card to fit one viewport */
.auth-card--compact {
  width: min(440px, 100%);
  padding: 14px 16px 12px;
  border-radius: 18px;
}

.auth-card--compact .auth-card__title {
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.auth-card--compact .auth-card__lead {
  margin-bottom: 8px;
  font-size: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Form primitives ---- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: none;
}

.auth-card--compact .auth-form {
  gap: 7px;
}

.auth-form__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-form__label {
  color: rgba(43, 33, 28, 0.9);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.auth-card--compact .auth-form__label {
  font-size: 0.7rem;
}

.auth-form__hint {
  margin: 0;
  color: rgba(43, 33, 28, 0.62);
  font-size: 0.72rem;
  line-height: 1.35;
}

.auth-form__input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.36);
  color: #2b211c;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.auth-card--compact .auth-form__input {
  padding: 7px 10px;
  font-size: 0.875rem;
  border-radius: 10px;
}

.auth-form__input::placeholder {
  color: rgba(43, 33, 28, 0.4);
}

.auth-form__input:focus {
  border-color: rgba(245, 130, 32, 0.55);
  background: rgba(255, 255, 255, 0.72);
}

.auth-form__input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-form__input--code {
  font-size: 1.125rem;
  letter-spacing: 0.12em;
  text-align: center;
}

.auth-form__row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}

.auth-form__row .auth-form__input {
  flex: 1 1 140px;
  min-width: 0;
}

.auth-form__email-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.22);
}

.auth-card--compact .auth-form__email-block {
  gap: 5px;
  padding: 6px;
}

.auth-form__submit,
.auth-form__secondary {
  appearance: none;
  border: none;
  cursor: pointer;
  font-weight: 750;
  border-radius: 999px;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.auth-form__submit {
  align-self: stretch;
  margin-top: 4px;
  padding: 10px 16px;
  min-height: 40px;
  background: #f58220;
  color: #fff;
  font-size: 0.9rem;
  box-shadow: 0 8px 20px rgba(245, 130, 32, 0.28);
}

.auth-card--compact .auth-form__submit {
  margin-top: 2px;
  padding: 8px 14px;
  min-height: 36px;
  font-size: 0.85rem;
}

.auth-form__submit:hover,
.auth-form__submit:focus-visible {
  background: #e86e00;
  outline: none;
}

.auth-form__secondary {
  padding: 8px 14px;
  background: rgba(245, 130, 32, 0.16);
  color: #c45f12;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.auth-form__secondary:hover,
.auth-form__secondary:focus-visible {
  background: rgba(245, 130, 32, 0.24);
  outline: none;
}

.auth-form__submit:disabled,
.auth-form__secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-form__check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: #2b211c;
  font-size: 0.75rem;
  line-height: 1.4;
}

.auth-card--compact .auth-form__check {
  font-size: 0.7rem;
  gap: 6px;
}

.auth-form__check a {
  color: #c45f12;
  font-weight: 700;
  text-decoration: underline;
}

.auth-alert {
  margin: 0;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.auth-alert--error {
  color: #8a2f17;
  background: rgba(242, 118, 32, 0.16);
}

.auth-alert--info {
  color: #5a4d44;
  background: rgba(107, 91, 82, 0.12);
}

.auth-links {
  margin: 12px 0 0;
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
  color: rgba(43, 33, 28, 0.7);
}

.auth-card--compact .auth-links {
  margin-top: 8px;
  font-size: 0.7rem;
}

.auth-links a {
  color: #c45f12;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Password strength (signup) */
.auth-strength {
  margin: 0;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.28);
  color: #2b211c;
  font-size: 0.7rem;
  line-height: 1.35;
}

.auth-strength__level {
  margin: 0 0 2px;
  font-weight: 700;
}

.auth-strength__rules {
  margin: 0;
  padding-left: 1.1em;
}

.auth-strength__rules li {
  margin: 1px 0;
}

.auth-strength__rules li.is-met {
  color: #2f6b3c;
}

.auth-strength__rules li.is-miss {
  color: #8a2f17;
}

.auth-form__confirm-msg {
  margin: 0;
  min-height: 1.1em;
  color: #8a2f17;
  font-size: 0.7rem;
  line-height: 1.3;
}

/* Captcha */
.auth-captcha {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-captcha img {
  height: 36px;
  width: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.85);
}

.auth-captcha__refresh {
  border: none;
  background: transparent;
  color: #c45f12;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Auth navbar action button on glass bar */
.auth-glass-nav .auth-nav-action {
  color: #2b211c;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
}

.auth-glass-nav .auth-nav-action:hover,
.auth-glass-nav .auth-nav-action:focus-visible {
  background: rgba(255, 255, 255, 0.55);
  outline: none;
}

/* Photo pages: scene layer uses ds-scene-bg stretch (top below navbar) */
.site-body--parent-login .site-bg,
.site-body--parent-register .site-bg,
.site-body--child-login .site-bg {
  background-size: var(--ds-scene-bg-size, 100% 100%);
  background-position: var(--ds-scene-bg-position, center center);
  background-repeat: var(--ds-scene-bg-repeat, no-repeat);
}

/* Photo cover pages keep immersive bg; card sits on top */
.site-body--parent-login .site-bg::before,
.site-body--parent-login .site-bg::after,
.site-body--parent-register .site-bg::before,
.site-body--parent-register .site-bg::after,
.site-body--child-login .site-bg::before,
.site-body--child-login .site-bg::after {
  content: none;
  display: none;
}

@media (max-width: 480px) {
  .auth-main {
    padding: calc(var(--ds-navbar-height, 64px) + 6px) 10px 10px;
    align-items: flex-start;
  }

  .auth-card {
    padding: 18px 16px 14px;
  }

  .auth-card--compact {
    padding: 10px 12px 8px;
    border-radius: 16px;
  }

  .auth-card--compact .auth-card__lead {
    margin-bottom: 6px;
    -webkit-line-clamp: 1;
  }

  .auth-card--compact .auth-form {
    gap: 5px;
  }

  .auth-card--compact .auth-form__hint {
    display: none;
  }

  .auth-card--compact .auth-strength__rules {
    display: none;
  }

  .auth-card--compact .auth-strength {
    padding: 4px 6px;
  }

  .auth-form__secondary {
    width: 100%;
  }
}

/* Prefer one-screen signup on typical laptop heights */
@media (min-height: 780px) and (min-width: 481px) {
  .auth-main--signup {
    align-items: center;
  }
}
