/* ========================================
   LOGIN SCREEN
   ======================================== */

.login-screen {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  font-family: 'Outfit', sans-serif;
  background: #0a0f1a;
  color: #c8cdd6;
}

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

.bg-canvas::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(22, 32, 56, 0.9) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 90%, rgba(15, 27, 45, 0.8) 0%, transparent 50%),
    radial-gradient(ellipse 120% 100% at 50% 50%, #0a0f1a 0%, #060a12 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0;
}

.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(212, 168, 83, 0.12) 0%, transparent 70%);
  top: -10%; left: -5%;
  animation: float1 25s ease-in-out infinite, loginFadeIn 2s ease forwards;
}

.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(212, 168, 83, 0.08) 0%, transparent 70%);
  bottom: -15%; right: -10%;
  animation: float2 30s ease-in-out infinite, loginFadeIn 2s ease 0.5s forwards;
}

.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(30, 45, 74, 0.4) 0%, transparent 70%);
  top: 40%; left: 60%;
  animation: float3 22s ease-in-out infinite, loginFadeIn 2s ease 1s forwards;
}

.orb-4 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(160, 125, 58, 0.05) 0%, transparent 60%);
  top: 60%; left: -20%;
  animation: float4 28s ease-in-out infinite, loginFadeIn 3s ease 0.3s forwards;
}

@keyframes loginFadeIn { to { opacity: 1; } }

@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, 40px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-40px, -30px) scale(1.1); }
  66% { transform: translate(20px, -10px) scale(0.9); }
}

@keyframes float3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-50px, 30px); }
}

@keyframes float4 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -40px) scale(1.08); }
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 70%);
}

.noise {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* Particles */
.particle {
  position: fixed;
  width: 2px;
  height: 2px;
  background: #d8c371;
  border-radius: 50%;
  opacity: 0;
  animation: particle 8s ease-in-out infinite;
}

.particle:nth-child(2) { left: 15%; top: 20%; animation-delay: 0s; animation-duration: 10s; }
.particle:nth-child(3) { left: 75%; top: 60%; animation-delay: 2s; animation-duration: 12s; }
.particle:nth-child(4) { left: 40%; top: 80%; animation-delay: 4s; animation-duration: 9s; }
.particle:nth-child(5) { left: 85%; top: 25%; animation-delay: 1s; animation-duration: 11s; }
.particle:nth-child(6) { left: 25%; top: 55%; animation-delay: 3s; animation-duration: 13s; }

@keyframes particle {
  0%, 100% { opacity: 0; transform: translateY(0) scale(1); }
  25% { opacity: 0.4; }
  50% { opacity: 0.15; transform: translateY(-30px) scale(1.5); }
  75% { opacity: 0.3; }
}

/* Corner Accents */
.accent-line {
  position: fixed;
  z-index: 0;
  animation: loginFadeIn 2s ease 1.5s both;
}

.accent-top-right {
  top: 40px;
  right: 40px;
  width: 80px;
  height: 80px;
  border-top: 1px solid rgba(212, 168, 83, 0.1);
  border-right: 1px solid rgba(212, 168, 83, 0.1);
}

.accent-bottom-left {
  bottom: 40px;
  left: 40px;
  width: 80px;
  height: 80px;
  border-bottom: 1px solid rgba(212, 168, 83, 0.1);
  border-left: 1px solid rgba(212, 168, 83, 0.1);
}

/* Login Page Layout */
.login-page {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100vh;
  height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: env(safe-area-inset-top, 20px);
}

/* Glass Card */
.login-screen .login-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 52px 44px 44px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(15, 27, 45, 0.7) 0%, rgba(10, 15, 26, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(40px) saturate(1.2);
  -webkit-backdrop-filter: blur(40px) saturate(1.2);
  box-shadow:
    0 0 0 1px rgba(212, 168, 83, 0.04),
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 24px 80px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: cardEnter 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(30px);
}

@keyframes cardEnter {
  to { opacity: 1; transform: translateY(0); }
}

.login-screen .login-card::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px; bottom: -1px;
  border-radius: 25px;
  background: linear-gradient(135deg, rgba(212, 168, 83, 0.15) 0%, transparent 40%, transparent 60%, rgba(212, 168, 83, 0.08) 100%);
  z-index: -1;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  padding: 1px;
}

.login-screen .login-card::after {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 168, 83, 0.3), transparent);
  border-radius: 1px;
}

/* Brand */
.brand {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeUp 0.8s ease 0.3s both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.brand-logo {
  width: 280px;
  max-width: 100%;
  height: auto;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  animation: fadeUp 0.8s ease 0.5s both;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.divider-diamond {
  width: 6px;
  height: 6px;
  background: #b3a35a;
  transform: rotate(45deg);
  opacity: 0.5;
}

/* Form */
.form-group {
  margin-bottom: 20px;
  animation: fadeUp 0.8s ease 0.6s both;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7a94;
  margin-bottom: 10px;
}

.input-wrapper {
  position: relative;
}

.input-wrapper input {
  width: 100%;
  padding: 16px 50px 16px 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 300;
  color: #eef0f4;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  outline: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.02em;
}

.input-wrapper input::placeholder {
  color: rgba(107, 122, 148, 0.5);
  font-weight: 300;
}

.input-wrapper input:focus {
  border-color: rgba(212, 168, 83, 0.3);
  background: rgba(212, 168, 83, 0.03);
  box-shadow:
    0 0 0 3px rgba(212, 168, 83, 0.06),
    0 4px 16px rgba(0, 0, 0, 0.2);
}

.toggle-pw {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6b7a94;
  cursor: pointer;
  opacity: 0.4;
  transition: all 0.3s ease;
  padding: 4px;
}

.toggle-pw:hover {
  color: #d8c371;
  opacity: 0.8;
}

.login-error {
  color: #e5d698;
  font-size: 13px;
  text-align: center;
  min-height: 20px;
  margin-top: 8px;
}

/* Login Button */
.btn-login {
  width: 100%;
  padding: 17px;
  margin-top: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0a0f1a;
  background: linear-gradient(135deg, #d8c371 0%, #e5d698 50%, #d8c371 100%);
  background-size: 200% 200%;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  animation: fadeUp 0.8s ease 0.7s both;
}

.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn-login:hover {
  background-position: 100% 100%;
  box-shadow:
    0 4px 20px rgba(212, 168, 83, 0.3),
    0 8px 40px rgba(212, 168, 83, 0.15);
  transform: translateY(-1px);
}

.btn-login:hover::before {
  transform: translateX(100%);
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 2px 12px rgba(212, 168, 83, 0.2);
}

/* Card Footer */
.card-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  animation: fadeUp 0.8s ease 0.9s both;
}

.card-footer p {
  font-size: 12px;
  color: #6b7a94;
  font-weight: 300;
  letter-spacing: 0.02em;
}

/* Login Responsive */
@media (max-width: 520px) {
  .login-screen .login-card {
    padding: 40px 28px 36px;
    border-radius: 20px;
  }

  .accent-line { display: none; }
}

/* Hide login elements when app is shown */
.login-screen.hidden .bg-canvas,
.login-screen.hidden .particle,
.login-screen.hidden .accent-line {
  display: none;
}
