/* ═══ SIGDX Login — Cinema v2 ═══
   Cinema panel + glassmorphism form
   Sections: Shell · Cinema · Controls · Form · Responsive · Reduced Motion
   ═══════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   SHELL
   ═══════════════════════════════════════════════════════════════ */

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #142040;
}

.login-shell {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  overflow: hidden;
}


/* ═══════════════════════════════════════════════════════════════
   CINEMA PANEL — fills entire viewport behind form
   ═══════════════════════════════════════════════════════════════ */

.login-cinema {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #142040;
  z-index: 0;
  display: flex;
  flex-direction: column;
}

/* ── Animated aurora background ── */
.login-cinema-aurora {
  position: absolute; inset: -30%; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 25% 35%, rgba(37,99,235,0.36) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 70% 65%, rgba(8,145,178,0.29) 0%, transparent 55%),
    radial-gradient(ellipse 50% 60% at 50% 50%, rgba(99,102,241,0.17) 0%, transparent 50%);
  animation: aurora-drift 25s ease-in-out infinite;
}
.login-cinema-aurora::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 75% 50% at 65% 25%, rgba(34,211,238,0.26) 0%, transparent 55%),
    radial-gradient(ellipse 60% 55% at 25% 75%, rgba(37,99,235,0.22) 0%, transparent 55%),
    radial-gradient(ellipse 45% 40% at 80% 55%, rgba(139,92,246,0.14) 0%, transparent 50%);
  animation: aurora-drift-2 30s ease-in-out infinite;
}
.login-cinema-aurora::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 100% 70% at 40% 50%, rgba(37,99,235,0.17) 0%, transparent 50%),
    radial-gradient(ellipse 50% 80% at 75% 35%, rgba(8,145,178,0.14) 0%, transparent 50%);
  animation: aurora-breathe 18s ease-in-out infinite;
}
@keyframes aurora-drift {
  0%   { transform: translate(0,0)      scale(1)    rotate(0deg); }
  25%  { transform: translate(4%,-2%)   scale(1.05) rotate(0.5deg); }
  50%  { transform: translate(2%, 3%)   scale(1.08) rotate(-0.3deg); }
  75%  { transform: translate(-3%, 1%)  scale(1.03) rotate(0.4deg); }
  100% { transform: translate(0,0)      scale(1)    rotate(0deg); }
}
@keyframes aurora-drift-2 {
  0%   { transform: translate(0,0)      scale(1.03) rotate(0deg); }
  25%  { transform: translate(-3%, 2%)  scale(0.97) rotate(-0.5deg); }
  50%  { transform: translate(3%,-1%)   scale(1.05) rotate(0.3deg); }
  75%  { transform: translate(1%,-3%)   scale(0.98) rotate(-0.2deg); }
  100% { transform: translate(0,0)      scale(1.03) rotate(0deg); }
}
@keyframes aurora-breathe {
  0%   { opacity: 0.3; transform: scale(1)    translate(0,0); }
  33%  { opacity: 0.8; transform: scale(1.06) translate(2%,-1%); }
  66%  { opacity: 1;   transform: scale(1.1)  translate(-2%, 2%); }
  100% { opacity: 0.3; transform: scale(1)    translate(0,0); }
}

/* ── Network canvas layer ── */
.login-cinema-streams { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.login-cinema-streams canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ── Hero text ── */
.hero-text {
  position: relative; z-index: 4; flex-shrink: 0;
  padding: 10px 40px 2px; padding-right: 460px;
  pointer-events: none;
}
.hero-main {
  font-size: clamp(22px, 2.2vw, 34px); font-weight: 700; line-height: 1.18;
  letter-spacing: -0.03em; color: #f1f5f9; margin-bottom: 6px;
  text-shadow: 0 0 30px rgba(96,165,250,0.10), 0 2px 4px rgba(0,0,0,0.25);
}
.hero-main em {
  font-style: normal;
  background: linear-gradient(135deg, #60a5fa 0%, #22d3ee 40%, #a78bfa 80%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub {
  font-size: clamp(12px, 0.85vw, 15px); font-weight: 500; line-height: 1.6;
  color: #7a8faa; white-space: nowrap; text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ── SVG viewport ── */
.login-cinema-viewport {
  position: relative; z-index: 2; flex: 1 1 0%; min-height: 0; overflow: hidden;
  margin: 0; margin-right: 440px;
  display: flex; align-items: center; justify-content: center;
}
.login-cinema-viewport svg { position: relative; width: 100%; height: 100%; display: block; }


/* ═══════════════════════════════════════════════════════════════
   TIMELINE CONTROLS
   ═══════════════════════════════════════════════════════════════ */

.cinema-controls {
  position: relative; z-index: 4; flex-shrink: 0;
  width: calc(100% - 440px); margin-bottom: 16px;
  padding: 1px 40px 0;
  transform: scale(0.7); transform-origin: bottom center;
}
.controls-track {
  height: 2px; background: rgba(148,163,184,0.12); border-radius: 1px;
  margin-bottom: 5px; position: relative; overflow: hidden; cursor: pointer;
}
.controls-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #2563eb, #0891b2);
  border-radius: 1px; width: 0%;
}
.controls-labels { display: flex; justify-content: space-between; }

/* Scene jump buttons */
.ctrl-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  color: rgba(148,163,184,0.35); transition: color 0.3s;
  padding: 2px 0; text-transform: uppercase;
}
.ctrl-btn:hover { color: rgba(148,163,184,0.7); }
.ctrl-btn.active { color: rgba(96,165,250,0.9); }
.ctrl-btn .ctrl-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.5; transition: all 0.3s; }
.ctrl-btn.active .ctrl-dot { opacity: 1; box-shadow: 0 0 6px rgba(96,165,250,0.4); }

/* Play/pause button */
.ctrl-play-row { display: flex; justify-content: center; margin: 4px 0 2px; }
.ctrl-play {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; padding: 0;
  background: rgba(96,165,250,0.10); border: 1px solid rgba(96,165,250,0.22);
  color: rgba(96,165,250,0.50); cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.ctrl-play:hover { background: rgba(96,165,250,0.20); border-color: rgba(96,165,250,0.50); color: rgba(96,165,250,0.95); }
.ctrl-play.playing { color: rgba(96,165,250,0.85); border-color: rgba(96,165,250,0.35); }


/* ═══════════════════════════════════════════════════════════════
   FORM PANEL — Floating glassmorphism card over cinema
   ═══════════════════════════════════════════════════════════════ */

.login-stage {
  position: relative;
  z-index: 5;
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  align-self: stretch;
  width: min(440px, 100vw - 32px);
  display: flex;
  flex-direction: column;
  padding: 32px 36px;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    -8px 0 40px rgba(0, 0, 0, 0.25),
    -2px 0 12px rgba(37, 99, 235, 0.08);
  overflow-y: auto;
  animation: form-slide-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Ambient glow on the left edge of form panel */
.login-stage::after {
  content: "";
  position: absolute;
  top: 10%;
  bottom: 10%;
  left: -1px;
  width: 1px;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(96, 165, 250, 0.4) 30%,
    rgba(34, 211, 238, 0.5) 50%,
    rgba(96, 165, 250, 0.4) 70%,
    transparent 100%);
  box-shadow:
    0 0 12px rgba(96, 165, 250, 0.3),
    0 0 30px rgba(34, 211, 238, 0.15);
  animation: edge-glow-pulse 4s ease-in-out infinite alternate;
}

/* Top accent bar */
.login-stage::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent, #2563eb) 0%, var(--accent-teal, #0891b2) 60%, transparent 100%);
}

@keyframes form-slide-in {
  0% {
    opacity: 0;
    transform: translateX(30px);
    backdrop-filter: blur(0px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
    backdrop-filter: blur(24px);
  }
}

@keyframes edge-glow-pulse {
  0%   { opacity: 0.5; box-shadow: 0 0 8px rgba(96, 165, 250, 0.2), 0 0 20px rgba(34, 211, 238, 0.1); }
  100% { opacity: 1;   box-shadow: 0 0 16px rgba(96, 165, 250, 0.4), 0 0 40px rgba(34, 211, 238, 0.2); }
}

/* ── Logo header ── */
.login-stage-header {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: max-content;
  margin-bottom: 0;
}

.login-stage-header .nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
}

.login-stage-header .nav-logo-icon,
.login-stage-header .nav-logo-accent {
  color: var(--accent-teal, hsl(199, 89%, 42%));
}

.login-stage-header .nav-logo-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-strong, #080d17);
}

.login-stage-sub {
  padding-left: 33px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted, #7a8ba0);
}

/* ── Card area: centered form ── */
.login-card {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
}

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

.login-card-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: calc(100vh - 160px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.login-card-frame::before {
  display: none;
}

/* ── Form header ── */
.login-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

.login-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent, #2563eb);
}

.login-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.5vw, 30px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-strong, #080d17);
}

.login-subtitle {
  margin: 0;
  max-width: 34ch;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-soft, #3a4560);
}

/* ── Form fields ── */
.login-form,
.login-2fa {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft, #3a4560);
}

.login-input,
.totp-digit {
  border: 1px solid var(--border-strong, #bcc6da);
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-sm, 8px);
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-strong, #080d17);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input {
  min-height: 44px;
  padding: 0 12px;
}

.login-input:focus,
.totp-digit:focus {
  outline: none;
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11);
}

.login-input::placeholder {
  color: var(--text-muted, #7a8ba0);
}

.login-password-wrap {
  position: relative;
}

.login-password-wrap .login-input {
  padding-right: 44px;
}

.login-eye-btn {
  position: absolute;
  inset: 6px 6px 6px auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border, #dde3ee);
  border-radius: var(--radius-sm, 8px);
  background: var(--surface-3, #edf0f7);
  color: var(--text-soft, #3a4560);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.login-eye-btn:hover {
  background: var(--accent-soft, #eef3ff);
  border-color: rgba(37, 99, 235, 0.2);
  color: var(--accent, #2563eb);
}

.login-eye-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

/* ── Submit button ── */
.login-submit {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-sm, 8px);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-teal) 100%);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.22);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.26);
  filter: saturate(1.05);
}

.login-submit:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18);
}

.login-submit.loading::after {
  content: "";
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: login-spin 0.7s linear infinite;
}

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

/* ── Error state ── */
.login-error {
  padding: 10px 12px;
  border-radius: var(--radius-sm, 8px);
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.15);
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.5;
}

/* ── 2FA section ── */
.login-2fa-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm, 8px);
  background: var(--accent-soft, #eef3ff);
  color: var(--accent, #2563eb);
}

.login-2fa-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-2fa-text {
  color: var(--text-strong, #080d17);
  font-weight: 700;
  font-size: 14px;
}

.login-2fa-subtext {
  color: var(--text-soft, #3a4560);
  font-size: 13px;
  line-height: 1.6;
}

.login-totp-inputs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.totp-digit {
  min-height: 48px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-strong, #080d17);
}

/* ── Links ── */
.login-link {
  border: 0;
  background: none;
  color: var(--text-soft, #3a4560);
  text-align: center;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.14s ease;
}

.login-link:hover {
  color: var(--accent, #2563eb);
}

/* ── Trust checkbox ── */
.login-trust-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft, #3a4560);
  font-size: 13px;
}

/* ── Card footer ── */
.login-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #dde3ee);
  color: var(--text-muted, #7a8ba0);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.login-card-footer svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* Large screens (>1600px) */
@media (min-width: 1600px) {
  .login-stage { width: 460px; }
  .hero-text { padding-right: 480px; }
  .login-cinema-viewport { margin-right: 460px; }
  .cinema-controls { width: calc(100% - 460px); }
}

/* Medium screens */
@media (max-width: 1024px) {
  .login-stage { width: min(380px, 100vw - 16px); padding: 24px 28px; }
  .hero-text { padding-right: 400px; }
  .login-cinema-viewport { margin-right: 380px; }
  .cinema-controls { width: calc(100% - 380px); }
}

/* Small screens — form takes full width */
@media (max-width: 760px) {
  .login-stage {
    width: 100%;
    border-left: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    padding: 20px 20px 24px;
    animation: none;
  }

  .login-stage::after {
    display: none;
  }

  .hero-text,
  .cinema-controls {
    display: none;
  }

  .login-cinema-viewport {
    margin-right: 0;
  }

  .login-stage-sub {
    padding-left: 0;
  }
}


/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .login-cinema-aurora,
  .login-cinema-aurora::before,
  .login-cinema-aurora::after {
    animation: none;
  }

  .login-cinema-viewport svg {
    display: none;
  }

  .login-cinema-viewport {
    background:
      radial-gradient(circle at 40% 50%, rgba(37, 99, 235, 0.15) 0%, transparent 50%),
      radial-gradient(circle at 70% 40%, rgba(8, 145, 178, 0.10) 0%, transparent 40%);
  }
}
