/**
 * Login portal UI/UX layer (student-portal.php, forgot-password.php).
 * Loaded after login-portals.css.
 */

.student-portal-page {
  --portal-accent: #800000;
  --portal-accent-2: #c0394b;
  --portal-accent-deep: #5f0d33;
  --portal-accent-soft: rgba(128, 0, 0, 0.13);
  --portal-btn-start: #a3172b;
  --portal-btn-mid: #800000;
  --portal-btn-end: #5f0d33;
  --portal-btn-shadow: rgba(128, 0, 0, 0.32);
  --portal-link: #800000;
  --portal-link-hover: #5f0d33;
  --lx-gold: #f6ae2d;
  --lx-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --lx-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.student-portal-page ::selection {
  background: rgba(128, 0, 0, 0.85);
  color: #fff;
}

/* ---- Staggered entrance of the form column ---- */
.psu-lx-stagger > * {
  animation: psu-lx-rise 0.6s var(--lx-ease) both;
}
.psu-lx-stagger > :nth-child(1) { animation-delay: 0.05s; }
.psu-lx-stagger > :nth-child(2) { animation-delay: 0.1s; }
.psu-lx-stagger > :nth-child(3) { animation-delay: 0.15s; }
.psu-lx-stagger > :nth-child(4) { animation-delay: 0.2s; }
.psu-lx-stagger > :nth-child(5) { animation-delay: 0.24s; }
.psu-lx-stagger > :nth-child(6) { animation-delay: 0.28s; }
.psu-lx-stagger > :nth-child(7) { animation-delay: 0.34s; }
.psu-lx-stagger > :nth-child(8) { animation-delay: 0.42s; }
.psu-lx-stagger > :nth-child(9) { animation-delay: 0.48s; }
.psu-lx-stagger > :nth-child(n + 10) { animation-delay: 0.54s; }

@keyframes psu-lx-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---- Brand seal with a slowly turning gold ring ---- */
@property --lx-ring {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.psu-lx-logo {
  position: relative;
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(from var(--lx-ring), var(--lx-gold), #800000, #ffe0a3, #800000, var(--lx-gold));
  box-shadow: 0 8px 20px -6px rgba(128, 0, 0, 0.45);
  animation: psu-lx-ring 8s linear infinite;
}
.psu-lx-logo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #fff;
  object-fit: cover;
}
@keyframes psu-lx-ring {
  to { --lx-ring: 360deg; }
}

/* ---- Live dot + gradient headline ---- */
.psu-lx-live {
  position: relative;
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: #800000;
}
.psu-lx-live::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: psu-lx-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.psu-lx-live--green {
  background: #22c55e;
}
@keyframes psu-lx-ping {
  75%, 100% { transform: scale(2.6); opacity: 0; }
}

.psu-lx-grad {
  background: linear-gradient(90deg, #800000 0%, #c0394b 40%, #800000 80%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: psu-lx-shimmer 6s ease-in-out infinite;
}
@keyframes psu-lx-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ---- Tabs: sliding pill indicator (JS positions it) ---- */
.psu-lx-tab-ind {
  position: absolute;
  top: 0.25rem;
  bottom: 0.25rem;
  left: 0.25rem;
  width: 0;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 2px 8px rgba(80, 10, 25, 0.12), 0 0 0 1px rgba(128, 0, 0, 0.06);
  opacity: 0;
  pointer-events: none;
}
.psu-lx-ready .psu-lx-tab-ind {
  opacity: 1;
}
.psu-lx-animate .psu-lx-tab-ind {
  transition: left 0.38s var(--lx-ease), width 0.38s var(--lx-ease);
}
.psu-lx-ready .student-portal-tab {
  position: relative;
  z-index: 1;
  background: transparent !important;
  box-shadow: none !important;
  color: #6b7280 !important;
  transition: color 0.25s ease;
}
.psu-lx-ready .student-portal-tab:hover {
  color: #374151 !important;
}
.psu-lx-ready .student-portal-tab[aria-selected="true"] {
  color: var(--portal-accent) !important;
}

.psu-lx-panel-in {
  animation: psu-lx-panel 0.4s var(--lx-ease) both;
}
@keyframes psu-lx-panel {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---- Fields with leading icons ---- */
.psu-lx-field {
  position: relative;
}
.psu-lx-field > input {
  padding-left: 2.85rem !important;
}
.psu-lx-field__ico {
  position: absolute;
  left: 1rem;
  top: 50%;
  z-index: 2;
  width: 1.15rem;
  height: 1.15rem;
  translate: 0 -50%;
  color: #a58c96;
  pointer-events: none;
  transition: color 0.2s ease, scale 0.25s var(--lx-spring);
}
.psu-lx-field:focus-within .psu-lx-field__ico {
  color: var(--portal-accent);
  scale: 1.1;
}
.student-portal-page .psu-login-form input:focus {
  border-color: var(--portal-accent);
  box-shadow: 0 0 0 4px var(--portal-accent-soft), 0 6px 16px -8px rgba(128, 0, 0, 0.35);
}
.student-portal-page .psu-login-form input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 40px #fff8f5 inset;
  -webkit-text-fill-color: #1a1a1a;
}

/* ---- Caps Lock / strength / match hints ---- */
.psu-lx-caps {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #b45309;
  animation: psu-lx-panel 0.25s var(--lx-ease) both;
}
.psu-lx-caps svg {
  width: 0.9rem;
  height: 0.9rem;
}
.psu-lx-caps[hidden],
.psu-lx-match[hidden] {
  display: none;
}

.psu-lx-strength {
  margin-top: 0.55rem;
}
.psu-lx-strength__bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
}
.psu-lx-strength__bars span {
  height: 4px;
  border-radius: 9999px;
  background: #eadde1;
  transition: background-color 0.3s ease, transform 0.3s var(--lx-spring);
}
.psu-lx-strength__text {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: #6b7280;
}
.psu-lx-strength[data-level="1"] .psu-lx-strength__bars span:nth-child(-n + 1) { background: #dc2626; }
.psu-lx-strength[data-level="2"] .psu-lx-strength__bars span:nth-child(-n + 2) { background: #f59e0b; }
.psu-lx-strength[data-level="3"] .psu-lx-strength__bars span:nth-child(-n + 3) { background: #65a30d; }
.psu-lx-strength[data-level="4"] .psu-lx-strength__bars span { background: #15803d; }
.psu-lx-strength[data-level="1"] .psu-lx-strength__text { color: #b91c1c; }
.psu-lx-strength[data-level="2"] .psu-lx-strength__text { color: #b45309; }
.psu-lx-strength[data-level="3"] .psu-lx-strength__text { color: #4d7c0f; }
.psu-lx-strength[data-level="4"] .psu-lx-strength__text { color: #15803d; }

.psu-lx-match {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.psu-lx-match.is-ok { color: #15803d; }
.psu-lx-match.is-bad { color: #b91c1c; }

/* ---- Submit button: shine, arrow, loading state ---- */
.psu-lx-submit {
  position: relative;
  gap: 0.55rem;
  overflow: hidden;
  font-weight: 700;
}
.psu-lx-submit::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.25) 50%, transparent 70%);
  translate: -120% 0;
  transition: translate 0.8s var(--lx-ease);
  pointer-events: none;
}
.psu-lx-submit:hover::after {
  translate: 120% 0;
}
.psu-lx-submit__arrow {
  width: 1.05rem;
  height: 1.05rem;
  color: #ffd27a;
  transition: translate 0.3s var(--lx-spring);
}
.psu-lx-submit:hover .psu-lx-submit__arrow {
  translate: 4px 0;
}
.psu-lx-spinner {
  display: none;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: psu-lx-spin 0.7s linear infinite;
}
.psu-lx-submit.is-loading {
  pointer-events: none;
  filter: saturate(0.85);
}
.psu-lx-submit.is-loading .psu-lx-submit__arrow { display: none; }
.psu-lx-submit.is-loading .psu-lx-spinner { display: inline-block; }
@keyframes psu-lx-spin {
  to { rotate: 360deg; }
}

[data-password-wrap] > [data-password-toggle]:focus-visible {
  outline: 2px solid var(--portal-accent);
  outline-offset: 1px;
  border-radius: 0.5rem;
}

/* ---- Reset steps (forgot-password) ---- */
.psu-lx-steps {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0;
  padding: 0;
  list-style: none;
}
.psu-lx-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  color: #9ca3af;
}
.psu-lx-step__num {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 800;
  color: #9ca3af;
  background: #fff;
  border: 2px solid #e5d7dc;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.psu-lx-step__num svg {
  width: 0.9rem;
  height: 0.9rem;
}
.psu-lx-step.is-current {
  color: var(--portal-accent);
}
.psu-lx-step.is-current .psu-lx-step__num {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--portal-btn-start), var(--portal-btn-end));
  box-shadow: 0 0 0 4px var(--portal-accent-soft), 0 6px 14px -6px var(--portal-btn-shadow);
  animation: psu-lx-pop 0.5s 0.3s var(--lx-spring) both;
}
.psu-lx-step.is-done {
  color: #15803d;
}
.psu-lx-step.is-done .psu-lx-step__num {
  color: #fff;
  border-color: transparent;
  background: #16a34a;
}
.psu-lx-steps__line {
  position: relative;
  flex: 1;
  min-width: 1.5rem;
  height: 3px;
  border-radius: 9999px;
  background: #ebdfe3;
  overflow: hidden;
}
.psu-lx-steps__line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #16a34a, var(--portal-accent));
  transform-origin: left;
  transform: scaleX(0);
}
.psu-lx-steps__line.is-done::after {
  animation: psu-lx-fill 0.7s 0.2s var(--lx-ease) both;
}
@keyframes psu-lx-fill {
  to { transform: scaleX(1); }
}
@keyframes psu-lx-pop {
  0% { scale: 0.6; }
  100% { scale: 1; }
}
@media (max-width: 420px) {
  .psu-lx-steps { gap: 0.4rem; }
  .psu-lx-step { gap: 0.35rem; }
  .psu-lx-step__label { font-size: 0.7rem; }
  .psu-lx-steps__line { min-width: 0.75rem; }
}

/* ---- Code sent + on-screen code card ---- */
.psu-lx-sent__ico {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.65rem;
  color: #15803d;
  background: #fff;
  border: 1px solid #bbf7d0;
}
.psu-lx-sent__ico svg {
  width: 1.1rem;
  height: 1.1rem;
}

.psu-lx-codecard {
  position: relative;
  overflow: hidden;
  padding: 1.1rem 1rem 1rem;
  border-radius: 1.1rem;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(246, 174, 45, 0.25) 0%, rgba(246, 174, 45, 0) 55%),
    linear-gradient(135deg, var(--portal-btn-start) 0%, var(--portal-btn-mid) 55%, var(--portal-btn-end) 100%);
  box-shadow: 0 16px 32px -14px var(--portal-btn-shadow);
}
.psu-lx-codecard__kicker {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 236, 214, 0.85);
}
.psu-lx-codecard__digits {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.7rem;
}
.psu-lx-codecard__digits span {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 3rem;
  border-radius: 0.65rem;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  animation: psu-lx-rise 0.45s calc(0.35s + var(--i, 0) * 0.07s) var(--lx-spring) both;
}
.psu-lx-codecard__use {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #3b0a0a;
  background: linear-gradient(135deg, #ffe0a3, var(--lx-gold));
  border: 0;
  cursor: pointer;
  box-shadow: 0 6px 16px -6px rgba(20, 2, 6, 0.5);
  transition: translate 0.25s var(--lx-ease), box-shadow 0.25s ease;
}
.psu-lx-codecard__use:hover {
  translate: 0 -2px;
  box-shadow: 0 10px 20px -8px rgba(20, 2, 6, 0.6);
}
.psu-lx-codecard__use:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.psu-lx-codecard__use svg {
  width: 0.95rem;
  height: 0.95rem;
}
.psu-lx-codecard__use.is-done {
  color: #fff;
  background: #16a34a;
}
.psu-lx-codecard__note {
  margin-top: 0.55rem;
  font-size: 0.7rem;
  color: rgba(255, 236, 214, 0.75);
}

.psu-login-form input.psu-lx-code {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.5em;
}
.psu-login-form input.psu-lx-code::placeholder {
  letter-spacing: 0.5em;
  color: #d1c3c8;
}
.psu-login-form input.psu-lx-code.is-complete {
  border-color: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.14);
}

/* ---- Hero panel ---- */
.psu-login-hero__img {
  animation: psu-lx-kenburns 28s ease-in-out infinite alternate;
}
@keyframes psu-lx-kenburns {
  from { transform: scale(1.04) translate(0, 0); }
  to { transform: scale(1.14) translate(-1.5%, -1%); }
}
.psu-login-page .psu-hero-film {
  background:
    radial-gradient(90% 60% at 100% 0%, rgba(246, 174, 45, 0.18) 0%, rgba(246, 174, 45, 0) 60%),
    linear-gradient(180deg, rgba(70, 8, 18, 0.35) 0%, rgba(80, 10, 22, 0.3) 35%, rgba(40, 4, 12, 0.88) 78%, rgba(24, 3, 8, 0.96) 100%);
}

.psu-lx-hero-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem 0.4rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(20, 2, 6, 0.25);
  animation: psu-lx-rise 0.6s 0.5s var(--lx-ease) both;
}

.psu-lx-hero-title {
  letter-spacing: -0.02em;
  animation: psu-lx-rise 0.7s 0.35s var(--lx-ease) both;
}
.psu-lx-gold {
  background: linear-gradient(90deg, var(--lx-gold), #ffe0a3, var(--lx-gold));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: psu-lx-shimmer 5s ease-in-out infinite;
}
.psu-hero-text > p:first-child,
.psu-hero-text > p:nth-child(3) {
  animation: psu-lx-rise 0.7s 0.3s var(--lx-ease) both;
}

.psu-lx-hero-list li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  animation: psu-lx-rise 0.6s var(--lx-ease) both;
}
.psu-lx-hero-list li:nth-child(1) { animation-delay: 0.55s; }
.psu-lx-hero-list li:nth-child(2) { animation-delay: 0.65s; }
.psu-lx-hero-list li:nth-child(3) { animation-delay: 0.75s; }
.psu-lx-hero-list__ico {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  color: var(--lx-gold);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.psu-lx-hero-list__ico svg {
  width: 1rem;
  height: 1rem;
}

.psu-lx-hero-sparks span {
  position: absolute;
  bottom: -10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lx-gold);
  box-shadow: 0 0 10px 2px rgba(246, 174, 45, 0.6);
  opacity: 0;
  animation: psu-lx-float 9s linear infinite;
}
.psu-lx-hero-sparks span:nth-child(1) { left: 12%; animation-delay: 0s; }
.psu-lx-hero-sparks span:nth-child(2) { left: 30%; animation-delay: 2.5s; animation-duration: 11s; }
.psu-lx-hero-sparks span:nth-child(3) { left: 48%; animation-delay: 5s; width: 4px; height: 4px; }
.psu-lx-hero-sparks span:nth-child(4) { left: 66%; animation-delay: 1.2s; animation-duration: 12s; }
.psu-lx-hero-sparks span:nth-child(5) { left: 80%; animation-delay: 3.8s; width: 3px; height: 3px; }
.psu-lx-hero-sparks span:nth-child(6) { left: 92%; animation-delay: 6.5s; animation-duration: 10s; }
@keyframes psu-lx-float {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: 0.9; }
  80% { opacity: 0.5; }
  100% { transform: translateY(-110vh); opacity: 0; }
}

@media (max-width: 1023.98px) {
  .psu-login-hero {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }
  .psu-login-hero .psu-hero-text {
    position: relative;
    inset: auto;
    padding-top: 3.75rem;
  }
}

@media (min-width: 640px) and (max-width: 1023.98px) {
  .psu-login-hero .psu-hero-text {
    padding-top: 4.5rem;
  }
}

/* ---- Reduced motion: keep the layout, drop the movement ---- */
@media (prefers-reduced-motion: reduce) {
  .psu-lx-stagger > *,
  .psu-lx-logo,
  .psu-lx-live::after,
  .psu-lx-grad,
  .psu-lx-gold,
  .psu-lx-panel-in,
  .psu-lx-caps,
  .psu-login-hero__img,
  .psu-lx-hero-chip,
  .psu-lx-hero-title,
  .psu-hero-text > p,
  .psu-lx-hero-list li,
  .psu-lx-step.is-current .psu-lx-step__num,
  .psu-lx-codecard__digits span {
    animation: none !important;
  }
  .psu-lx-steps__line.is-done::after {
    animation: none;
    transform: scaleX(1);
  }
  .psu-lx-codecard__use {
    transition: none;
  }
  .psu-lx-hero-sparks {
    display: none;
  }
  .psu-lx-animate .psu-lx-tab-ind,
  .psu-lx-submit::after,
  .psu-lx-submit__arrow,
  .psu-lx-field__ico {
    transition: none;
  }
}
