* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, sans-serif;
  background: #0e3f7a;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: none;
}

.flash-success,
.flash-error {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 10px 16px;
  border-radius: 14px;
  text-align: center;
  font-weight: 700;
  z-index: 2;
}

.flash-success {
  color: #155724;
  background: #d4edda;
}

.flash-error {
  color: #842029;
  background: #f8d7da;
}

.flash-success p,
.flash-error p {
  margin: 0;
}

/* Keep scrolling owned by the page only so nested cards do not create a second scrollbar. */
.login-app {
  width: 100%;
  max-width: 100vw;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 32px);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 16%, rgba(118, 206, 255, 0.36) 0 10%, transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(89, 164, 255, 0.44) 0 13%, transparent 34%),
    radial-gradient(circle at 68% 86%, rgba(39, 105, 205, 0.5) 0 16%, transparent 38%),
    linear-gradient(135deg, #0f376c 0%, #1f67b4 54%, #67bde7 100%);
}

.login-app::before,
.login-app::after {
  content: "";
  position: absolute;
  inset: -20%;
  pointer-events: none;
}

.login-app::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.09) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.09) 2px, transparent 2px);
  background-size: 64px 64px;
  transform: rotate(-9deg) scale(1.1);
  opacity: 0.45;
}

.login-app::after {
  background:
    radial-gradient(circle at 12% 78%, rgba(255, 255, 255, 0.2) 0 3px, transparent 4px),
    radial-gradient(circle at 28% 28%, rgba(255, 255, 255, 0.16) 0 4px, transparent 5px),
    radial-gradient(circle at 74% 34%, rgba(255, 255, 255, 0.18) 0 3px, transparent 4px),
    radial-gradient(circle at 88% 72%, rgba(255, 255, 255, 0.16) 0 5px, transparent 6px);
  background-size: 220px 220px;
  opacity: 0.58;
  animation: loginBackgroundDots 18s ease-in-out infinite alternate;
}



@keyframes loginBackgroundDots {
  0% {
    transform: translate3d(-8px, -4px, 0);
  }

  50% {
    transform: translate3d(10px, 8px, 0);
  }

  100% {
    transform: translate3d(-2px, 14px, 0);
  }
}

.login-card {
  width: min(960px, 100%);
  min-height: min(680px, calc(100dvh - 24px));
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: clamp(14px, 3vw, 34px);
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 4vw, 48px);
  border-radius: 38px;
  background:
    linear-gradient(145deg, rgba(235, 248, 255, 0.94) 0%, rgba(218, 239, 255, 0.91) 46%, rgba(204, 229, 255, 0.9) 100%);
  box-shadow:
    0 34px 90px rgba(5, 34, 76, 0.38),
    inset 0 0 0 2px rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(225, 244, 255, 0.66);
  backdrop-filter: blur(10px);
  z-index: 1;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 28px;
  border: 2px dashed rgba(37, 132, 214, 0.18);
  pointer-events: none;
}

.login-card::after {
  content: "";
  position: absolute;
  left: -110px;
  right: -110px;
  bottom: -165px;
  height: 250px;
  background:
    radial-gradient(ellipse at center, rgba(91, 183, 255, 0.18) 0%, rgba(91, 183, 255, 0.1) 36%, transparent 70%);
  pointer-events: none;
}

.login-form-card {
  grid-template-rows: auto 1fr;
  max-width: 720px;
}

.hidden {
  display: none !important;
}

.login-language-picker {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
  color: #123a6c;
  z-index: 2;
  padding: 8px 10px 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(37, 132, 214, 0.14);
}

.login-language-picker select {
  height: 40px;
  border: none;
  border-radius: 14px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.88);
  color: #0d315d;
  font-weight: bold;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(37, 132, 214, 0.18);
}

.login-hero {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.login-spark {
  position: absolute;
  width: clamp(54px, 7vw, 92px);
  height: clamp(54px, 7vw, 92px);
  display: grid;
  place-items: center;
  border-radius: 28px;
  font-size: clamp(28px, 4vw, 54px);
  font-weight: 900;
  transform: rotate(-8deg);
  opacity: 0.28;
  box-shadow: 0 18px 38px rgba(5, 38, 86, 0.18);
}

.login-spark-one {
  left: clamp(12px, 5vw, 48px);
  top: clamp(82px, 15vw, 132px);
  color: #1d76bd;
  background: rgba(224, 244, 255, 0.8);
}

.login-spark-two {
  right: clamp(12px, 5vw, 52px);
  top: clamp(82px, 15vw, 136px);
  color: #2488d6;
  background: rgba(210, 237, 255, 0.84);
  transform: rotate(12deg);
}

.login-spark-three {
  right: clamp(18px, 7vw, 72px);
  bottom: clamp(22px, 7vw, 70px);
  color: #5db5f2;
  background: rgba(221, 245, 255, 0.8);
  transform: rotate(-14deg);
}

.login-copy {
  text-align: center;
  position: relative;
  z-index: 2;
  padding: 0 clamp(76px, 14vw, 170px);
}

.login-kicker {
  margin: 0 0 8px;
  color: #1d76bd;
  font-size: clamp(15px, 1.4vw, 19px);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-copy h1,
.login-form-heading h1 {
  margin: 0;
  color: #1d76bd;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.96;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.82);
}


.login-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 28px);
  align-self: center;
  z-index: 1;
}

.login-type-card {
  min-height: clamp(210px, 26vw, 290px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: clamp(18px, 3vw, 32px);
  border: 0;
  border-radius: 34px;
  color: #fff;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 18px 40px rgba(5, 43, 98, 0.3);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  position: relative;
  overflow: hidden;
}

a.login-type-card,
a.login-secondary-btn {
  text-decoration: none;
}

a.login-secondary-btn {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.login-type-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 44%),
    linear-gradient(315deg, transparent 0%, rgba(255, 255, 255, 0.11) 100%);
  pointer-events: none;
}

.login-type-card:hover,
.login-type-card:focus-visible {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 24px 52px rgba(5, 43, 98, 0.36);
  outline: none;
  filter: brightness(1.04);
}

.teacher-card {
  background: linear-gradient(315deg, #1557a6 0%, #2488d6 48%, #5db5f2 100%);
}

.student-card {
  background: linear-gradient(315deg, #0f6f91 0%, #23a8c6 48%, #8fe3f4 100%);
}

.school-card {
  background: linear-gradient(315deg, #175c50 0%, #2aa37f 50%, #8fe7c6 100%);
}

.district-card {
  background: linear-gradient(315deg, #5b3a94 0%, #8a62d2 50%, #c9a7ff 100%);
}

.login-type-icon,
.login-form-icon {
  width: clamp(72px, 9vw, 108px);
  height: clamp(72px, 9vw, 108px);
  display: grid;
  place-items: center;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.24);
  font-size: clamp(42px, 6vw, 66px);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
  z-index: 1;
}

.login-type-title,
.login-type-note {
  z-index: 1;
}

.login-type-title {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 900;
}

.login-type-note {
  max-width: 280px;
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: bold;
  line-height: 1.3;
  opacity: 0.94;
}

.login-form-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  z-index: 1;
}

.login-form-icon {
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(315deg, #1557a6, #5db5f2);
  box-shadow: 0 16px 32px rgba(16, 95, 174, 0.28);
}

.login-form {
  display: grid;
  align-content: center;
  gap: 18px;
  z-index: 1;
}

.login-field {
  display: grid;
  gap: 8px;
  color: #123a6c;
  font-size: clamp(17px, 1.8vw, 24px);
  font-weight: 900;
}

.login-field input {
  width: 100%;
  height: clamp(56px, 6vw, 72px);
  border: none;
  border-radius: 22px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.82);
  color: #0d315d;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: bold;
  outline: none;
  box-shadow:
    inset 0 0 0 2px rgba(37, 132, 214, 0.14),
    0 12px 24px rgba(5, 43, 98, 0.08);
}

.login-field input:focus {
  background: #fff;
  box-shadow: inset 0 0 0 3px rgba(28, 139, 223, 0.5), 0 0 0 5px rgba(28, 139, 223, 0.16);
}

.login-remember-control {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  color: #24354b;
  cursor: pointer;
}

.login-remember-control input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: #2459a9;
}

.login-remember-label,
.login-remember-note {
  display: block;
}

.login-remember-label { font-weight: 700; }

.login-remember-note {
  margin-top: 0.15rem;
  color: #5d6b7c;
  font-size: 0.86rem;
}

.login-form-heading-copy { min-width: 0; }

.login-switch-role {
  position: absolute;
  inset-block-start: clamp(18px, 4vw, 48px);
  inset-inline-start: clamp(18px, 4vw, 48px);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 2px solid rgba(21, 87, 166, 0.22);
  border-radius: 999px;
  color: #1557a6;
  background: rgba(255, 255, 255, 0.56);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.login-switch-role:hover,
.login-switch-role:focus-visible {
  background: #fff;
  outline: 3px solid rgba(246, 182, 37, 0.7);
  outline-offset: 2px;
}

.login-password-control { position: relative; }
.login-password-control input { padding-inline-end: 78px; }
.login-password-toggle {
  position: absolute;
  inset-inline-end: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  border-radius: 14px;
  width: 48px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  background: #176fbd;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}
.login-password-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.login-password-icon-slash { display: none; }
.login-password-toggle.is-visible .login-password-icon-slash { display: block; }
.login-password-toggle:hover { filter: brightness(1.08); }
.login-password-toggle:focus-visible { outline: 3px solid #f6b625; outline-offset: 2px; }

.login-caps-lock {
  margin: 0;
  color: #8a4b00;
  font-size: 14px;
  font-weight: 800;
}

.login-auth-messages:focus {
  outline: 3px solid rgba(180, 53, 53, 0.3);
  outline-offset: 3px;
  border-radius: 14px;
}

.login-auth-messages { position: relative; }

.login-trial-expired {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid #c43d4b;
  border-radius: 0.85rem;
  background: #fff2f3;
  color: #741825;
}

.login-trial-expired-icon { font-size: 1.4rem; line-height: 1.2; }
.login-trial-expired h2 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.login-trial-expired p { margin: 0.3rem 0 0; line-height: 1.45; }
.login-trial-expired-data { font-weight: 700; }

.login-auth-dismiss {
  position: absolute;
  inset-block-start: 7px;
  inset-inline-end: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  color: #713434;
  background: rgba(255, 255, 255, 0.72);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.login-auth-dismiss:focus-visible {
  outline: 3px solid rgba(113, 52, 52, 0.35);
  outline-offset: 2px;
}

.login-auth-messages .flash-error,
.login-auth-messages .flash-success {
  margin: 0;
  text-align: center;
}

.login-auth-messages .flash-error p,
.login-auth-messages .flash-success p {
  text-align: center;
}

.login-offline-status,
.login-timeout-status {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  color: #713f00;
  background: #fff3cd;
  font-size: 15px;
  font-weight: 800;
}

.login-offline-status.is-online {
  color: #155b3a;
  background: #dcf5e8;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-prototype-note {
  margin: 0;
  color: #16406f;
  font-size: clamp(14px, 1.4vw, 18px);
  font-weight: bold;
  text-align: center;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
}

.login-form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}

.login-primary-btn,
.login-secondary-btn {
  min-height: clamp(58px, 6vw, 76px);
  border: none;
  border-radius: 24px;
  color: #fff;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(5, 43, 98, 0.24);
  transition: transform 160ms ease, filter 160ms ease;
}

.login-primary-btn {
  background: linear-gradient(315deg, #1557a6, #2488d6, #5db5f2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.login-primary-btn:disabled {
  cursor: wait;
  filter: saturate(0.82);
}

.login-submit-spinner {
  display: none;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: login-submit-spin 700ms linear infinite;
}

.login-form.is-submitting .login-submit-spinner {
  display: inline-block;
}

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

@media (prefers-reduced-motion: reduce) {
  .login-submit-spinner { animation: none; }
}

.login-secondary-btn {
  background: linear-gradient(315deg, #16406f, #3f78aa);
}

.login-primary-btn:hover,
.login-primary-btn:focus-visible,
.login-secondary-btn:hover,
.login-secondary-btn:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.05);
  outline: none;
}

.login-app[dir="rtl"] .login-form-heading {
  flex-direction: row-reverse;
  text-align: right;
}

@media (max-width: 720px) {
  body {
    overflow: auto;
  }

  .login-app {
    align-items: flex-start;
  }

  .login-card {
    min-height: auto;
    border-radius: 30px;
  }

  .login-choice-grid,
  .login-form-actions {
    grid-template-columns: 1fr;
  }

  .login-type-card {
    min-height: 190px;
  }

  .login-language-picker {
    justify-self: stretch;
    justify-content: space-between;
    max-width: 100%;
  }

  .login-language-picker select {
    min-width: 0;
    max-width: 100%;
  }

  .login-form-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .login-copy {
    padding: 0 clamp(56px, 16vw, 96px);
  }

  .login-spark {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    font-size: 28px;
  }

  .login-spark-one {
    left: 12px;
    top: 86px;
  }

  .login-spark-two {
    right: 12px;
    top: 86px;
  }

}


/* Login 2 comparison layout: vertically stacked role choices */
.login2-app {
  display: grid;
  place-items: center;
  justify-content: center;
  align-content: center;
}

.login2-app,
.login2-app * {
  min-width: 0;
}

.login2-card {
  width: min(760px, calc(100vw - clamp(32px, 6vw, 84px)));
  max-width: 760px;
  min-height: min(720px, calc(100dvh - 24px));
  grid-template-rows: auto auto auto auto;
  justify-items: center;
  justify-self: center;
  margin-inline: auto;
}

.login2-card .login-language-picker {
  justify-self: center;
  width: fit-content;
  max-width: 100%;
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
  margin-inline: auto;
}

.login2-card .login-language-picker select {
  max-width: min(100%, 280px);
  min-width: 0;
}

.login2-card .login-copy {
  width: 100%;
  max-width: 100%;
}

.login2-choice-stack {
  grid-template-columns: 1fr;
  justify-self: center;
  align-self: stretch;
  max-width: 580px;
  width: min(100%, 580px);
  margin-inline: auto;
  gap: clamp(14px, 2.4vw, 22px);
}

.login2-choice-stack .login-type-card {
  min-height: clamp(150px, 18vw, 190px);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  justify-items: start;
  align-items: center;
  column-gap: clamp(16px, 3vw, 26px);
  row-gap: 4px;
  text-align: left;
  padding: clamp(18px, 3vw, 28px);
}

.login2-choice-stack .login-type-icon {
  grid-row: 1 / span 2;
  width: clamp(70px, 8vw, 96px);
  height: clamp(70px, 8vw, 96px);
}

.login2-choice-stack .login-type-title {
  align-self: end;
}

.login2-choice-stack .login-type-note {
  align-self: start;
  max-width: none;
}

.login2-choice-stack .login-type-card:hover,
.login2-choice-stack .login-type-card:focus-visible {
  transform: translateX(4px) translateY(-3px) scale(1.01);
}

.login-app[dir="rtl"] .login2-choice-stack .login-type-card {
  text-align: right;
  justify-items: end;
}

@media (max-width: 720px) {
  .login2-app {
    align-items: start;
    place-items: start center;
    justify-content: center;
  }

  .login2-card {
    width: min(100%, calc(100vw - clamp(24px, 6vw, 40px)));
  }
}

@media (max-width: 620px) {
  .login2-choice-stack .login-type-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    justify-items: center;
    text-align: center;
  }

  .login2-choice-stack .login-type-icon {
    grid-row: auto;
  }

  .login2-choice-stack .login-type-card:hover,
  .login2-choice-stack .login-type-card:focus-visible {
    transform: translateY(-3px) scale(1.01);
  }
}


@media (max-width: 520px) {
  .login2-card {
    width: min(100%, calc(100vw - 24px));
    padding-inline: clamp(16px, 5vw, 24px);
  }

  .login2-card .login-language-picker {
    width: 100%;
    justify-self: stretch;
  }

  .login2-card .login-language-picker label {
    flex: 0 0 auto;
  }

  .login2-card .login-language-picker select {
    flex: 1 1 180px;
    min-width: 0;
  }
}

/* Keep the Login 2 title centered independently of the decorative hero spacing. */
.login2-card .login-copy {
  display: flex;
  justify-content: center;
  justify-self: stretch;
  width: 100%;
  padding-inline: 0;
  text-align: center;
}

.login2-card #loginTitle {
  display: block;
  width: 100%;
  max-width: 620px;
  margin-inline: auto;
  text-align: center;
  text-wrap: balance;
}

@media (max-width: 520px) {
  .login2-card #loginTitle {
    max-width: 100%;
  }
}

/* Four-role login picker: compact cards keep Student, Teacher, School, and District usable on smaller screens. */
#loginChoiceScreen .login2-choice-stack {
  gap: clamp(10px, 2vw, 16px);
}

#loginChoiceScreen .login2-choice-stack .login-type-card {
  min-height: clamp(112px, 13vw, 150px);
}

#loginChoiceScreen .login2-choice-stack .login-type-icon {
  width: clamp(58px, 7vw, 82px);
  height: clamp(58px, 7vw, 82px);
  font-size: clamp(34px, 5vw, 54px);
}

/* App Select screen after the prototype login succeeds. */
.app-select-card {
  grid-template-rows: auto 1fr;
  align-content: center;
  justify-items: center;
  max-width: 760px;
}

.app-select-copy {
  align-self: end;
  display: grid !important;
  gap: clamp(8px, 1.5vw, 14px);
}

.app-select-welcome {
  margin: 0;
  color: #16406f;
  font-size: clamp(20px, 2.6vw, 34px);
  letter-spacing: 0.02em;
  text-transform: none;
}

.app-select-grid {
  align-self: start;
  margin-top: clamp(6px, 1.6vw, 14px);
}

.app-select-unavailable-message {
  width: min(100%, 560px);
  margin: 12px 0 0;
  border: 1px solid #edb0b0;
  border-radius: 12px;
  padding: 10px 16px;
  color: #842029;
  background: #f8d7da;
  font-weight: 700;
  text-align: center;
}

.app-select-unavailable-message:focus {
  outline: 3px solid rgba(180, 53, 53, 0.3);
  outline-offset: 3px;
}

.app-select-unavailable-message p {
  margin: 0;
}

.math-app-card {
  background: linear-gradient(315deg, #1557a6 0%, #2488d6 48%, #5db5f2 100%);
}

.animation-app-card {
  background: linear-gradient(315deg, #7a3db0 0%, #b35bd8 50%, #f0a7ff 100%);
}

.reading-app-card {
  background: linear-gradient(315deg, #6b7280 0%, #9ca3af 52%, #d1d5db 100%);
}

.management-app-card {
  background: linear-gradient(315deg, #175c50 0%, #2aa37f 50%, #8fe7c6 100%);
}


.app-management-heading {
  width: min(100%, 560px);
  margin: 0;
  color: #16406f;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 1;
}

.app-management-grid {
  width: min(100%, 560px);
  margin-top: 0;
}

.app-select-separator {
  width: min(100%, 560px);
  height: 2px;
  margin: clamp(4px, 1.2vw, 10px) 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(37, 132, 214, 0.42), transparent);
  z-index: 1;
}

.app-card-disabled,
.app-card-disabled:hover,
.app-card-disabled:focus-visible,
.app-card-disabled:active {
  cursor: not-allowed;
  filter: grayscale(0.15) saturate(0.6);
  opacity: 0.68;
  transform: none;
  box-shadow: 0 12px 28px rgba(5, 43, 98, 0.18);
}

.app-card-disabled .login-type-note {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.app-select-card .login-type-card {
  min-height: clamp(142px, 16vw, 178px);
}


.app-select-card .login-type-card {
  isolation: isolate;
}

.app-select-card .login-type-card::after {
  content: "";
  position: absolute;
  inset: 50%;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  z-index: 0;
}

.app-select-card .login-type-card:active {
  transform: translateX(2px) translateY(1px) scale(0.985);
  filter: brightness(0.99);
}

.app-select-card .login-type-card.app-card-clicked {
  animation: appCardClickPop 280ms ease-out;
}

.app-select-card .login-type-card.app-card-clicked::after {
  animation: appCardClickRipple 420ms ease-out;
}

.app-select-card .login-type-card.app-card-selected {
  box-shadow:
    0 24px 52px rgba(5, 43, 98, 0.34),
    0 0 0 5px rgba(255, 255, 255, 0.34),
    inset 0 0 0 2px rgba(255, 255, 255, 0.22);
}

@keyframes appCardClickPop {
  0% {
    transform: translateX(2px) translateY(1px) scale(0.985);
  }

  58% {
    transform: translateX(4px) translateY(-4px) scale(1.025);
  }

  100% {
    transform: translateX(4px) translateY(-3px) scale(1.01);
  }
}

@keyframes appCardClickRipple {
  0% {
    opacity: 0.62;
    transform: translate(-50%, -50%) scale(0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(24);
  }
}

.app-select-card .login-type-note {
  max-width: 360px;
}

.app-select-actions {
  width: min(100%, 560px);
  display: flex;
  justify-content: center;
  z-index: 1;
}

.app-logout-btn {
  width: min(100%, 260px);
  min-height: clamp(48px, 5vw, 60px);
  font-size: clamp(16px, 1.6vw, 22px);
  border-radius: 20px;
}



@media (max-width: 900px), (max-height: 760px) {
  .app-select-card {
    width: min(100%, calc(100vw - clamp(24px, 6vw, 56px)));
  }

  .app-select-grid,
  .app-management-grid {
    width: min(100%, 560px);
  }
}

@media (max-width: 520px), (max-height: 640px) {
  .app-select-welcome {
    font-size: clamp(18px, 5vw, 26px);
  }

  .app-select-card #appSelectTitle {
    font-size: clamp(34px, 11vw, 54px);
  }

  .app-select-card .login-type-card {
    min-height: auto;
  }

  .app-logout-btn {
    min-height: 46px;
  }
}

@media (max-width: 620px) {
  .app-select-card {
    align-content: start;
  }

  .app-select-copy {
    align-self: center;
  }
}

/* Let every screen scroll instead of clipping when the viewport is short. */
@media (max-height: 760px) {
  .login-app,
  .login2-app {
    align-items: start;
    place-items: start center;
    align-content: start;
  }

  .login-card,
  .login2-card,
  .login-form-card,
  .app-select-card {
    min-height: auto;
  }

  .login-card {
    gap: clamp(12px, 2.2vh, 22px);
    padding-block: clamp(16px, 3vh, 28px);
  }

  .login-copy h1,
  .login-form-heading h1 {
    font-size: clamp(34px, 7vh, 62px);
  }

  .login-type-card,
  .login2-choice-stack .login-type-card,
  .app-select-card .login-type-card {
    min-height: clamp(132px, 22vh, 178px);
  }

  .login-type-icon,
  .login-form-icon,
  .login2-choice-stack .login-type-icon {
    width: clamp(58px, 11vh, 84px);
    height: clamp(58px, 11vh, 84px);
    font-size: clamp(34px, 7vh, 54px);
    border-radius: 24px;
  }
}

@media (max-height: 640px) {
  .login-app {
    padding-block: 8px;
  }

  .login-language-picker {
    padding-block: 6px;
  }

  .login-language-picker select {
    height: 36px;
  }

  .login2-choice-stack,
  .app-select-grid,
  .app-management-grid {
    gap: 12px;
  }

  .login2-choice-stack .login-type-card,
  .app-select-card .login-type-card {
    min-height: auto;
    padding: 16px;
  }

  .login-type-title {
    font-size: clamp(21px, 4.8vh, 30px);
  }

  .login-type-note {
    font-size: clamp(14px, 3vh, 17px);
  }
}


/* Shared language picker placement for screens that are not using the login2-card layout. */
.login-form-card {
  grid-template-rows: auto auto 1fr;
}

.login-form-card .login-language-picker {
  justify-self: center;
  width: fit-content;
  max-width: 100%;
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
  margin-inline: auto;
}

.login-form-card .login-language-picker select {
  max-width: min(100%, 280px);
  min-width: 0;
}

@media (max-width: 520px) {
  .login-form-card .login-language-picker {
    width: 100%;
    justify-self: stretch;
  }

  .login-form-card .login-language-picker label {
    flex: 0 0 auto;
  }

  .login-form-card .login-language-picker select {
    flex: 1 1 180px;
  }
}

/* Smooth handoff between the login form and the App Select screen. */
.login-card-entering {
  animation: loginCardEnter 340ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.login-card-exiting {
  animation: loginCardExit 180ms ease-in both;
  pointer-events: none;
}

@keyframes loginCardEnter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    filter: blur(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes loginCardExit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }

  to {
    opacity: 0;
    transform: translateY(-12px) scale(0.99);
    filter: blur(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-card-entering,
  .login-card-exiting {
    animation: none;
    filter: none;
  }
}

/* Management cards are separate destinations; keep them compact because admins may see up to four. */
.app-management-grid .management-app-card {
  min-height: clamp(86px, 10vw, 120px);
}

.app-management-grid .login-type-title {
  align-self: center;
}
