
/* Final cascade guard: the legacy era-login layer used !important values. */
.role-entrance {
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  background: radial-gradient(circle at 10% 0%, rgba(214,226,216,.72), transparent 34%), #edf1ec !important;
}
.role-entrance-content {
  background: rgba(250,252,249,.94) !important;
}
.role-film {
  background: linear-gradient(145deg, #203b2e 0%, #14271e 100%) !important;
}
.role-film::after { content: none !important; display: none !important; }
/* Login v2: one stable layout for desktop, iPad and phone. */
.role-entrance {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 24px;
  padding: 24px;
  box-sizing: border-box;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 0%, rgba(214,226,216,.72), transparent 34%),
    #edf1ec;
  color: #18251f;
}
.role-entrance-content {
  min-width: 0;
  width: 100%;
  max-width: 620px;
  min-height: calc(100dvh - 48px);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 66px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 28px;
  background: rgba(250,252,249,.94);
  box-shadow: 0 24px 70px rgba(35,55,43,.10), 0 2px 8px rgba(35,55,43,.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.role-entrance-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 clamp(34px, 6vh, 68px);
  color: #214936;
  font: 800 20px/1.1 var(--font, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  letter-spacing: -.02em;
}
.role-entrance-brand>b {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: #214936;
  color: #fff;
  font: 700 27px/.8 Georgia, serif;
  letter-spacing: -.08em;
  box-shadow: 0 8px 18px rgba(33,73,54,.20);
}
.role-entrance-content>h1 {
  margin: 0;
  color: #17261f;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -.055em;
  font-weight: 820;
  text-shadow: none;
}
.role-entrance-content>p {
  max-width: 420px;
  margin: 13px 0 0;
  color: #64736a;
  font-size: 15px;
  line-height: 1.75;
  text-shadow: none;
}
.school-role-tabs {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 520px;
  margin: 30px 0 24px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-sizing: border-box;
}
.school-role-tabs button {
  position: relative;
  min-width: 0;
  min-height: 62px;
  margin: 0 !important;
  padding: 12px 8px !important;
  overflow: hidden;
  border: 1px solid #d9e2da !important;
  border-radius: 15px !important;
  background: #f8faf8 !important;
  color: #66756c !important;
  font-size: 15px;
  font-weight: 780;
  line-height: 1.2;
  box-shadow: none !important;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.school-role-tabs button::before {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: #9db2a3;
  transition: background-color .18s ease, transform .18s ease;
}
.school-role-tabs button[data-auth-role="teacher"]::before { background: #9aafc3; }
.school-role-tabs button[data-auth-role="admin"]::before { background: #b59eb0; }
.school-role-tabs button:hover {
  transform: translateY(-1px);
  border-color: #a9bcae !important;
  background: #f1f6f1 !important;
  color: #284f3a !important;
}
.school-role-tabs button[aria-pressed="true"] {
  border-color: #315d44 !important;
  background: #eef6ef !important;
  color: #204a33 !important;
  box-shadow: 0 8px 18px rgba(44,89,62,.10) !important;
}
.school-role-tabs button[aria-pressed="true"]::before {
  background: #315d44;
  transform: scale(1.3);
}
.school-role-tabs button[data-auth-role="teacher"][aria-pressed="true"] {
  border-color: #3f627e !important;
  background: #eef4f8 !important;
  color: #2b4d68 !important;
}
.school-role-tabs button[data-auth-role="teacher"][aria-pressed="true"]::before { background: #3f627e; }
.school-role-tabs button[data-auth-role="admin"][aria-pressed="true"] {
  border-color: #74536d !important;
  background: #f6eff5 !important;
  color: #5d3e57 !important;
}
.school-role-tabs button[data-auth-role="admin"][aria-pressed="true"]::before { background: #74536d; }
.school-role-tabs button:focus-visible {
  outline: 3px solid rgba(49,93,68,.24) !important;
  outline-offset: 3px;
}
.school-login {
  width: 100%;
  max-width: 520px;
  display: grid;
  gap: 9px;
  box-sizing: border-box;
}
.school-login > label {
  margin-top: 8px;
  color: #32473a;
  font-size: 13px;
  font-weight: 780;
}
.school-login .input {
  width: 100%;
  min-height: 52px;
  box-sizing: border-box;
  border: 1px solid #d7e1d8;
  border-radius: 13px;
  background: #fff;
  color: #22382b;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(33,60,43,.03);
}
.school-login .input::placeholder { color: #99a79d; }
.school-login .input:hover { border-color: #afc2b2; }
.school-login .input:focus-visible {
  border-color: #47745a;
  outline: 3px solid rgba(71,116,90,.16);
  outline-offset: 0;
}
.school-password { position: relative; min-width: 0; }
.school-password input { padding-right: 80px; }
.school-password button {
  position: absolute;
  right: 8px;
  top: 7px;
  bottom: 7px;
  min-width: 58px;
  padding: 0 9px;
  border-radius: 9px;
  color: #3a6549;
  font-size: 12px;
  font-weight: 780;
}
.school-password button:hover { background: #edf4ee; }
.school-login [role="alert"] {
  min-height: 20px;
  margin: 4px 0 0;
  color: #9b3934;
  font-size: 13px;
  line-height: 1.5;
}
.school-login [role="alert"]:empty { display: none; }
.school-login [type="submit"] {
  width: 100%;
  min-height: 54px;
  margin-top: 8px;
  border-radius: 13px;
  background: #28583f;
  border-color: #28583f;
  color: #fff;
  font-size: 15px;
  font-weight: 820;
  box-shadow: 0 12px 24px rgba(40,88,63,.18);
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.school-login [type="submit"]:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #204b35;
  box-shadow: 0 15px 28px rgba(40,88,63,.22);
}
.school-login-help {
  margin: 11px 0 0;
  color: #7a887e;
  font-size: 12px;
  line-height: 1.65;
}
.role-film {
  min-width: 0;
  min-height: calc(100dvh - 48px);
  display: grid;
  place-items: center;
  margin: 0;
  padding: clamp(18px, 3vw, 48px);
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 28px;
  background: linear-gradient(145deg, #203b2e 0%, #14271e 100%);
  box-shadow: 0 24px 70px rgba(24,50,37,.18);
}
.role-film-frame {
  position: relative;
  width: 100%;
  max-width: 1180px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(239,248,240,.24);
  border-radius: 20px;
  background: #16281f;
  box-shadow: 0 22px 50px rgba(5,18,11,.32), 0 0 0 8px rgba(255,255,255,.035);
}
.role-film-frame::after {
  content: "CNUHS TOEFL  ·  PRACTICE WITH PURPOSE";
  position: absolute;
  left: 18px;
  bottom: 16px;
  z-index: 2;
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(11,29,20,.62);
  color: rgba(243,250,244,.88);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .12em;
  pointer-events: none;
}
.role-film .role-background-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #16281f;
  pointer-events: none;
}
.role-film .auth-background-start {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  z-index: 4;
  transform: translate(-50%, -50%);
  padding: 13px 19px;
  border: 1px solid rgba(255,255,255,.56);
  border-radius: 999px;
  background: rgba(15,34,24,.88);
  color: #fff;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 780;
  box-shadow: 0 9px 28px rgba(0,0,0,.28);
}
.role-film .auth-background-start:hover { background: #244a35; }
.role-film [data-film-status] {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 5;
  margin: 0;
  padding: 10px 14px;
  text-align: center;
  color: #fff;
  background: rgba(13,29,20,.84);
  font-size: 12px;
}
.role-film [data-film-status]:empty { display: none; }
@media (max-width: 980px) {
  .role-entrance { grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr); gap: 14px; padding: 14px; }
  .role-entrance-content, .role-film { min-height: calc(100dvh - 28px); border-radius: 22px; }
  .role-entrance-content { padding: clamp(24px, 4vw, 40px); }
  .role-film { padding: 18px; }
}
@media (max-width: 760px) {
  .role-entrance {
    display: flex !important;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: #edf1ec !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
  }
  .role-entrance-content {
    order: 1;
    max-width: none;
    min-height: auto;
    padding: 30px 20px 34px;
    border: 0;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 10px 28px rgba(35,55,43,.08);
    background: #fafcf9;
  }
  .role-entrance-brand { margin-bottom: 32px; }
  .role-entrance-content>h1 { font-size: clamp(32px, 9vw, 43px); }
  .role-entrance-content>p { font-size: 14px; }
  .school-role-tabs { gap: 6px; margin-top: 25px !important; }
  .school-role-tabs button { min-height: 58px; padding: 10px 4px !important; font-size: 13px; }
  .school-role-tabs button::before { margin-bottom: 6px; }
  .school-login .input { min-height: 51px; }
  .role-film {
    order: 2;
    align-self: stretch;
    width: 100%;
    min-height: auto;
    padding: 22px 16px 30px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: linear-gradient(180deg, #203b2e, #14271e) !important;
  }
  .role-film-frame { border-radius: 15px; box-shadow: 0 16px 34px rgba(5,18,11,.28); }
  .role-film-frame::after { left: 10px; bottom: 10px; font-size: 8px; letter-spacing: .08em; }
}
@media (prefers-reduced-motion: reduce) {
  .school-role-tabs button, .school-login [type="submit"] { transition: none; }
  .school-role-tabs button:hover, .school-login [type="submit"]:hover:not(:disabled) { transform: none; }
}
