/* Login hero — engineering faculty front page (scoped; not used by app shell) */
:root {
  --login-navy: #12305e;
  --login-navy-deep: #0a1a36;
  --login-steel: #1a3a5c;
  --login-sky: #5ba3d9;
  --login-cyan: #3d8fb8;
  --login-mist: #e8f2f8;
  --login-panel: #f7fafc;
  --login-ink: #142033;
  --login-muted: #5a6a7c;
  --login-line: rgba(91, 163, 217, 0.35);
  --login-line-bright: rgba(125, 200, 230, 0.55);
  --login-font-display: "Sora", system-ui, sans-serif;
  --login-font-body: "Figtree", system-ui, sans-serif;
}

.login-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--login-font-body);
  color: var(--login-ink);
  background: var(--login-navy-deep);
  overflow-x: hidden;
}

.login-shell {
  display: grid;
  /* Panel first in DOM; place hero left / panel right on desktop */
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  grid-template-areas: "hero panel";
  min-height: 100vh;
}

.login-hero { grid-area: hero; }
.login-panel { grid-area: panel; }

/* ---- Full-bleed visual plane ---- */
.login-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(28px, 5vw, 56px);
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(61, 143, 184, 0.28), transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 15%, rgba(18, 48, 94, 0.9), transparent 50%),
    linear-gradient(155deg, #0a1a36 0%, #12305e 42%, #1a4a72 78%, #245a82 100%);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(125, 200, 230, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 200, 230, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 70%, transparent 100%);
  pointer-events: none;
  z-index: 0;
  animation: login-grid-drift 28s linear infinite;
}

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

.login-motifs svg {
  position: absolute;
  overflow: visible;
}

.motif-circuits {
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}

.motif-circuits .trace {
  fill: none;
  stroke: var(--login-line);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.motif-circuits .trace-bright {
  stroke: var(--login-line-bright);
  stroke-width: 1.5;
  stroke-dasharray: 12 180;
  animation: login-trace-flow 9s linear infinite;
}

.motif-circuits .pad {
  fill: rgba(91, 163, 217, 0.45);
  animation: login-pad-pulse 3.6s ease-in-out infinite;
}

.motif-circuits .pad:nth-child(odd) { animation-delay: 0.9s; }

.motif-network {
  top: 8%;
  right: 6%;
  width: min(42%, 320px);
  height: auto;
  opacity: 0.7;
}

.motif-network .edge {
  stroke: rgba(125, 200, 230, 0.35);
  stroke-width: 1;
  fill: none;
}

.motif-network .node {
  fill: rgba(232, 242, 248, 0.85);
}

.motif-network .node-core {
  fill: var(--login-sky);
  animation: login-node-glow 4s ease-in-out infinite;
}

.motif-network .pulse-ring {
  fill: none;
  stroke: rgba(91, 163, 217, 0.5);
  stroke-width: 1;
  transform-origin: center;
  animation: login-ring-expand 4.5s ease-out infinite;
}

.motif-gears {
  bottom: 18%;
  right: 8%;
  width: min(28%, 200px);
  height: auto;
  opacity: 0.4;
}

.motif-gears .gear {
  fill: none;
  stroke: rgba(168, 200, 224, 0.55);
  stroke-width: 1.5;
  transform-origin: center;
}

.motif-gears .gear-a {
  animation: login-gear-cw 18s linear infinite;
}

.motif-gears .gear-b {
  animation: login-gear-ccw 14s linear infinite;
}

.motif-structure {
  bottom: 0;
  left: 0;
  width: 70%;
  max-width: 640px;
  height: auto;
  opacity: 0.5;
}

.motif-structure .span {
  fill: none;
  stroke: rgba(168, 200, 224, 0.4);
  stroke-width: 1.5;
}

.motif-structure .deck {
  fill: rgba(125, 200, 230, 0.08);
  stroke: rgba(168, 200, 224, 0.35);
  stroke-width: 1;
}

.motif-structure .cable {
  fill: none;
  stroke: rgba(91, 163, 217, 0.3);
  stroke-width: 1;
  stroke-dasharray: 4 8;
  animation: login-cable-drift 12s linear infinite;
}

.login-hero-copy {
  position: relative;
  z-index: 2;
  max-width: 34rem;
}

.login-brand {
  font-family: var(--login-font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5.5vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 0.35em;
  color: #fff;
}

.login-brand em {
  font-style: normal;
  font-weight: 500;
  color: #9cc8e8;
}

.login-headline {
  font-family: var(--login-font-display);
  font-weight: 500;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.35;
  margin: 0 0 0.65em;
  color: #e4eef6;
  letter-spacing: -0.01em;
}

.login-support {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(210, 226, 240, 0.88);
  max-width: 28rem;
}

.login-faculty {
  display: block;
  margin-top: 1.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(156, 200, 232, 0.75);
}

/* ---- Sign-in panel ---- */
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 48px);
  background:
    linear-gradient(180deg, #f0f5f9 0%, var(--login-panel) 40%, #eef3f7 100%);
  position: relative;
  z-index: 3; /* above hero motifs; never let decorative SVG steal clicks */
  isolation: isolate;
}

.login-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(18, 48, 94, 0.12), transparent);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid rgba(18, 48, 94, 0.1);
  border-radius: 14px;
  padding: 28px 28px 30px;
  box-shadow: 0 12px 40px rgba(18, 48, 94, 0.08);
}

.login-card-label {
  font-family: var(--login-font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--login-cyan);
  margin: 0 0 6px;
}

.login-card h2 {
  font-family: var(--login-font-display);
  font-size: 1.35rem;
  font-weight: 650;
  margin: 0 0 6px;
  color: var(--login-navy);
  letter-spacing: -0.02em;
}

.login-card .lede {
  margin: 0 0 20px;
  font-size: 0.92rem;
  color: var(--login-muted);
  line-height: 1.45;
}

.login-sso-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  background: var(--login-mist);
  border-radius: 10px;
  border: 1px solid rgba(61, 143, 184, 0.22);
  font-size: 0.84rem;
  color: var(--login-muted);
  line-height: 1.45;
}

.login-sso-note strong {
  display: block;
  color: var(--login-navy);
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.login-source-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}

.login-source-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid #c8d4e0;
  background: #fff;
  color: var(--login-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.login-source-tab:hover {
  border-color: var(--login-cyan);
  color: var(--login-navy);
  text-decoration: none;
}

.login-source-tab.is-active {
  background: var(--login-navy);
  border-color: var(--login-navy);
  color: #fff;
}

.login-source-count {
  display: inline-flex;
  min-width: 1.25rem;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(18, 48, 94, 0.08);
  color: inherit;
}

.login-source-tab.is-active .login-source-count {
  background: rgba(255, 255, 255, 0.2);
}

.login-card label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  margin: 0 0 6px;
  color: #33404f;
}

.login-card select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #c8d4e0;
  border-radius: 9px;
  font: inherit;
  font-size: 0.92rem;
  background: #fff;
  color: var(--login-ink);
  appearance: auto;
}

.login-card select:focus {
  outline: 2px solid rgba(47, 111, 178, 0.35);
  outline-offset: 1px;
  border-color: var(--login-cyan);
}

.login-hint {
  margin: 14px 0 0;
  font-size: 0.8rem;
  color: var(--login-muted);
  line-height: 1.45;
}

.login-hint code {
  font-size: 0.78rem;
  background: var(--login-mist);
  padding: 1px 5px;
  border-radius: 4px;
}

.login-card .btn-signin {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 12px 16px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--login-navy) 0%, #1a4a78 100%);
  color: #fff;
  font-family: var(--login-font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.15s ease;
}

.login-card .btn-signin:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 20px rgba(18, 48, 94, 0.28);
  text-decoration: none;
}

.login-card .btn-signin:active {
  transform: translateY(1px);
}

.login-card .btn-signin.btn-microsoft {
  background: linear-gradient(135deg, #2f2f2f 0%, #111111 55%, #0078d4 160%);
  box-shadow: 0 4px 14px rgba(0, 120, 212, 0.22);
}

.login-card .btn-signin.btn-microsoft:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(0, 120, 212, 0.32);
}

.login-alert {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fdeceb;
  color: #8b1e18;
  font-size: 0.88rem;
  border: 1px solid #e6b0ad;
}

/* ---- Keyframes ---- */
@keyframes login-grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 48px 48px, 48px 48px; }
}

@keyframes login-trace-flow {
  to { stroke-dashoffset: -192; }
}

@keyframes login-pad-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes login-node-glow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes login-ring-expand {
  0% { transform: scale(0.55); opacity: 0.7; }
  100% { transform: scale(1.8); opacity: 0; }
}

@keyframes login-gear-cw {
  to { transform: rotate(360deg); }
}

@keyframes login-gear-ccw {
  to { transform: rotate(-360deg); }
}

@keyframes login-cable-drift {
  to { stroke-dashoffset: -48; }
}

@media (prefers-reduced-motion: reduce) {
  .login-hero::before,
  .motif-circuits .trace-bright,
  .motif-circuits .pad,
  .motif-network .node-core,
  .motif-network .pulse-ring,
  .motif-gears .gear-a,
  .motif-gears .gear-b,
  .motif-structure .cable {
    animation: none !important;
  }
}

@media (max-width: 900px) {
  /* Form first on narrow viewports so Sign in is above the fold */
  .login-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "panel"
      "hero";
  }

  .login-hero {
    min-height: 36vh;
    justify-content: flex-end;
    padding: 28px 24px 32px;
  }

  .login-brand {
    font-size: clamp(2rem, 9vw, 2.6rem);
  }

  .motif-network {
    width: 48%;
    top: 4%;
    right: 2%;
    opacity: 0.55;
  }

  .motif-gears {
    width: 26%;
    bottom: 28%;
    opacity: 0.32;
  }

  .motif-structure {
    width: 85%;
  }

  .login-panel {
    padding: 28px 20px 40px;
  }

  .login-panel::before { display: none; }
}
