/* ============================================================
   LOGIN PAGE — Premium Password Gate
   Animated gradient, glassmorphism, particles
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700&display=swap');

/* ---------- Variables (self-contained) ---------- */
:root {
  --login-deep-saffron: #FF6B2B;
  --login-royal-blue: #1A3A8A;
  --login-dark-navy: #0A1628;
  --login-gold: #C8A864;
  --login-white: #FFFFFF;
  --login-warm-gray: #6B7280;
  --login-glass-bg: rgba(255, 255, 255, 0.08);
  --login-glass-border: rgba(255, 255, 255, 0.15);
  --login-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--login-deep-saffron);
  color: var(--login-white);
}

/* ---------- Background ---------- */
.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.login-bg__gradient {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(26, 58, 138, 0.4), transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 107, 43, 0.15), transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(200, 168, 100, 0.12), transparent 50%),
    linear-gradient(135deg, #060d1a 0%, #0A1628 30%, #0f1f3d 60%, #0A1628 100%);
  animation: gradientShift 15s ease-in-out infinite alternate;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
    filter: hue-rotate(0deg);
  }
  50% {
    filter: hue-rotate(5deg);
  }
  100% {
    background-position: 100% 50%;
    filter: hue-rotate(-5deg);
  }
}

/* Floating Orbs */
.login-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: orbFloat 20s ease-in-out infinite;
}

.login-bg__orb--1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(26, 58, 138, 0.6), transparent 70%);
  top: -15%;
  left: -10%;
  animation-duration: 22s;
}

.login-bg__orb--2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 107, 43, 0.3), transparent 70%);
  bottom: -10%;
  right: -5%;
  animation-duration: 18s;
  animation-delay: -5s;
}

.login-bg__orb--3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(200, 168, 100, 0.25), transparent 70%);
  top: 40%;
  right: 20%;
  animation-duration: 25s;
  animation-delay: -10s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(15px, 30px) scale(1.02); }
}

/* Particle Canvas */
.login-bg__particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ---------- Login Container ---------- */
.login {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem;
}

/* ---------- Login Card ---------- */
.login__card {
  width: 100%;
  max-width: 420px;
  background: var(--login-glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--login-glass-border);
  border-radius: 24px;
  padding: 2.75rem 2.25rem 2.25rem;
  box-shadow: 
    0 32px 64px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  animation: cardEntry 0.8s var(--login-ease-out) both;
  transition: transform 0.5s var(--login-ease-out), 
              box-shadow 0.5s var(--login-ease-out);
}

.login__card.success {
  transform: scale(0.96);
  opacity: 0.7;
}

@keyframes cardEntry {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- Brand ---------- */
.login__brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login__brand-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, #FF6B2B, #F5A623);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 800;
  font-size: 1.7rem;
  color: var(--login-white);
  box-shadow: 0 4px 20px rgba(255, 107, 43, 0.35);
  animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(255, 107, 43, 0.35); }
  50% { box-shadow: 0 4px 30px rgba(255, 107, 43, 0.5); }
}

.login__brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--login-white);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.login__brand-role {
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--login-gold);
  margin-top: 0.35rem;
}

/* ---------- Divider ---------- */
.login__divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.login__divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 168, 100, 0.3), transparent);
}

.login__divider svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* ---------- Form ---------- */
.login__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.6rem;
  letter-spacing: 0.03em;
}

.login__input-wrap {
  position: relative;
  margin-bottom: 0.5rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.3s var(--login-ease-out);
  display: flex;
  align-items: center;
  padding: 0 1rem;
}

.login__input-wrap:focus-within {
  border-color: var(--login-gold);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(200, 168, 100, 0.15);
}

.login__input-wrap.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.login__input-wrap.success {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.login__input-icon {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.35);
  margin-right: 0.75rem;
}

.login__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--login-white);
  padding: 0.9rem 0;
  letter-spacing: 0.08em;
}

.login__input::placeholder {
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 0.15em;
}

.login__toggle-pass {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.35);
  padding: 4px;
  display: flex;
  transition: color 0.2s;
}

.login__toggle-pass:hover {
  color: rgba(255, 255, 255, 0.6);
}

/* Shake Animation */
.login__input-wrap.shake {
  animation: shake 0.5s var(--login-ease-out);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-8px); }
  30% { transform: translateX(6px); }
  45% { transform: translateX(-5px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

/* ---------- Error Message ---------- */
.login__error {
  font-size: 0.78rem;
  color: #f87171;
  min-height: 1.4rem;
  padding: 0.2rem 0;
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.3s var(--login-ease-out);
}

.login__error.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Submit Button ---------- */
.login__submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #FF6B2B, #F5A623);
  color: var(--login-white);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s var(--login-ease-out);
  box-shadow: 0 4px 16px rgba(255, 107, 43, 0.3);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.02em;
}

.login__submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255, 107, 43, 0.4);
}

.login__submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(255, 107, 43, 0.3);
}

.login__submit-arrow {
  transition: transform 0.3s var(--login-ease-out);
}

.login__submit:hover .login__submit-arrow {
  transform: translateX(3px);
}

/* ---------- Footer Note ---------- */
.login__footer-note {
  text-align: center;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.25);
  margin-top: 1.5rem;
  letter-spacing: 0.02em;
}

/* ---------- Bottom Credit ---------- */
.login__credit {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  animation: cardEntry 0.8s var(--login-ease-out) 0.3s both;
}

.login__credit p {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.02em;
}

.login__credit a {
  color: var(--login-gold);
  text-decoration: none;
  transition: color 0.2s;
}

.login__credit a:hover {
  color: var(--login-deep-saffron);
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .login {
    padding: 1.25rem;
  }

  .login__card {
    padding: 2rem 1.5rem 1.75rem;
    border-radius: 20px;
  }

  .login__brand-name {
    font-size: 1.4rem;
  }

  .login__brand-icon {
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
    border-radius: 14px;
  }
}

@media (max-height: 600px) {
  .login__card {
    padding: 1.5rem;
  }

  .login__brand {
    margin-bottom: 1rem;
  }

  .login__divider {
    margin-bottom: 1rem;
  }
}

/* ---------- Focus Visible ---------- */
:focus-visible {
  outline: 2px solid var(--login-gold);
  outline-offset: 2px;
  border-radius: 8px;
}

.login__input:focus-visible {
  outline: none;
}
