﻿/*
 * Purpose: Page-specific styles for login, including layout, components, states, and responsive behavior.
 * Keep page-only rules here; shared primitives belong in app.css.
 */
/* LOGIN PAGE - Liquid Glass */

.login-body {
  overflow-y: auto;
}

.login-page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 2;
}

.login-card {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(
    160deg,
    rgba(168, 85, 247, 0.07) 0%,
    rgba(255, 255, 255, 0.06) 40%,
    rgba(6, 182, 212, 0.04) 100%
  );
  -webkit-backdrop-filter: var(--blur-lg);
  backdrop-filter: var(--blur-lg);
  padding: 44px;
  border-radius: var(--r-2xl);
  box-shadow:
    var(--shadow-modal),
    0 0 0 1px rgba(168, 85, 247, 0.15),
    0 0 80px rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.20);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(168, 85, 247, 0.60) 30%,
    rgba(255,255,255,0.35) 50%,
    rgba(6, 182, 212, 0.50) 70%,
    transparent 100%
  );
  pointer-events: none;
}

.login-card::after {
  content: "";
  position: absolute;
  top: -160px; right: -160px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.14) 0%, rgba(255,51,71,0.08) 50%, transparent 70%);
  pointer-events: none;
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
  position: relative;
  z-index: 2;
}

.login-logo img {
  width: 120px;
  height: auto;
  margin-bottom: 18px;
  filter: drop-shadow(0 8px 24px rgba(255,51,71,0.40));
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  z-index: 2;
}

.login-form h2 {
  font-size: 26px;
  color: var(--text);
  margin-bottom: 4px;
  font-weight: 800;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.login-form input {
  width: 100%;
  padding: 15px 18px;
  border: 1px solid var(--border-glass-mid);
  border-radius: var(--r-md);
  background: var(--glass-8);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  -webkit-backdrop-filter: var(--blur-sm);
  backdrop-filter: var(--blur-sm);
}

.login-form input:focus {
  border-color: var(--border-primary);
  background: var(--glass-12);
  box-shadow: 0 0 0 4px rgba(255,51,71,0.18);
}

.login-form button {
  margin-top: 8px;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--primary);
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.02em;
  box-shadow: var(--primary-glow-strong);
}

.login-form button:hover {
  background: var(--primary-dim);
  transform: translateY(-2px);
  box-shadow: 0 20px 56px rgba(255,51,71,0.55);
}

.login-form button:active { transform: scale(0.98); }

.login-form .forgot-password-btn {
  margin-top: -4px;
  padding: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.login-form .forgot-password-btn:hover {
  background: transparent;
  box-shadow: none;
  color: var(--text);
  transform: none;
}

.demo-login {
  position: relative;
  z-index: 2;
  text-align: center;
}

.demo-login h2 {
  color: var(--text);
  font-size: 26px;
  font-weight: 800;
}

.demo-login p {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.login-help-text {
  margin: -4px 0 2px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

/* Password field with show/hide toggle (password-reset flow) */
.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 46px;
}

.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--r-sm);
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  cursor: pointer;
}

.password-toggle-btn::after { display: none; }

.password-toggle-btn:hover {
  background: var(--glass-6);
  color: var(--text-secondary);
  transform: translateY(-50%);
  box-shadow: none;
}

.password-toggle-btn:active {
  transform: translateY(-50%) scale(0.92);
  filter: none;
  box-shadow: none;
}

.password-toggle-btn .icon-eye-off { display: none; }
.password-toggle-btn.is-visible .icon-eye { display: none; }
.password-toggle-btn.is-visible .icon-eye-off { display: block; }

/* Live password-match feedback */
.field-hint {
  margin: -8px 0 0;
  font-size: 12.5px;
  color: var(--text-tertiary);
  transition: color var(--t-fast) var(--ease-snappy);
}

.field-hint.error { color: var(--danger); }
.field-hint.success { color: var(--success); }

.login-recaptcha {
  min-height: 78px;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.login-recaptcha[hidden] {
  display: none;
}

/* Intro Animation */

.login-intro {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 10% -10%, rgba(160,0,50,0.55) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 5%, rgba(15,25,80,0.65) 0%, transparent 50%),
    linear-gradient(180deg, #0c0e1e 0%, #08090f 100%);
  z-index: 99999;
  overflow: hidden;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.login-intro.hide { opacity: 0; visibility: hidden; }

.intro-logo {
  position: fixed;
  width: 220px;
  height: auto;
  opacity: 0;
  transform: translateY(80px) scale(0.5);
  animation: introLogoAppear 1.1s cubic-bezier(0.19, 1, 0.22, 1) forwards;
  filter: drop-shadow(0 16px 40px rgba(255,51,71,0.45));
  z-index: 100000;
}

/* Animation primitive used by this stylesheet. */
@keyframes introLogoAppear {
  0% { opacity: 0; transform: translateY(80px) scale(0.5); }
  60% { opacity: 1; transform: translateY(-8px) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card {
  opacity: 0;
  transform: translateY(24px);
  animation: loginContentFade 0.7s ease forwards;
  animation-delay: 2s;
}

/* Animation primitive used by this stylesheet. */
@keyframes loginContentFade {
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive overrides for this breakpoint. */
@media (max-width: 700px) {
  .login-card { max-width: calc(100vw - 40px); padding: 32px 28px; }
  .login-logo img { width: 100px; }
  .login-form h2 { font-size: 22px; }
  .intro-logo { width: 180px; }
}

/* Responsive overrides for this breakpoint. */
@media (max-width: 500px) {
  .login-card { max-width: calc(100vw - 32px); padding: 28px 22px; border-radius: var(--r-xl); }
  .login-logo img { width: 88px; }
  .intro-logo { width: 150px; }
}

/* Responsive overrides for this breakpoint. */
@media (max-width: 360px) {
  .login-page { padding: 14px; }
  .login-card { padding: 22px 18px; }
  .intro-logo { width: 120px; }
}
