:root {
   --primary-color: #4f46e5;
   --primary-hover: #4338ca;
   --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
   --bg-gradient: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
                  radial-gradient(circle at 90% 80%, rgba(217, 70, 239, 0.12) 0%, transparent 40%),
                  linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
   --glass-bg: rgba(255, 255, 255, 0.04);
   --glass-border: rgba(255, 255, 255, 0.1);
   --card-surface: rgba(30, 41, 59, 0.72);
   --input-bg: rgba(15, 23, 42, 0.6);
   --input-border: rgba(255, 255, 255, 0.12);
   --text-main: #f8fafc;
   --text-muted: #94a3b8;
   --gold-accent: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
}

* {
   box-sizing: border-box;
}

body.login-page {
   margin: 0;
   padding: 0;
   min-height: 100vh;
   display: flex;
   align-items: center;
   justify-content: center;
   font-family: 'Plus Jakarta Sans', 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
   background: var(--bg-gradient);
   color: var(--text-main);
   overflow-x: hidden;
   position: relative;
}

/* Staging mode override */
body.login-page.is-staging-bg {
   background: radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.2) 0%, transparent 40%),
               radial-gradient(circle at 90% 80%, rgba(5, 150, 105, 0.15) 0%, transparent 40%),
               linear-gradient(135deg, #064e3b 0%, #022c22 60%, #0f172a 100%) !important;
}

/* Decorative ambient glow orbs */
.ambient-glow {
   position: absolute;
   border-radius: 50%;
   filter: blur(90px);
   pointer-events: none;
   z-index: 0;
   opacity: 0.6;
   animation: floatGlow 12s ease-in-out infinite alternate;
}

.ambient-glow-1 {
   width: 420px;
   height: 420px;
   background: radial-gradient(circle, rgba(99, 102, 241, 0.45) 0%, rgba(79, 70, 229, 0) 70%);
   top: -10%;
   left: -5%;
}

.ambient-glow-2 {
   width: 480px;
   height: 480px;
   background: radial-gradient(circle, rgba(217, 70, 239, 0.35) 0%, rgba(168, 85, 247, 0) 70%);
   bottom: -15%;
   right: -5%;
   animation-delay: -6s;
}

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

.login-container {
   width: 100%;
   max-width: 440px;
   padding: 24px 16px;
   position: relative;
   z-index: 1;
   margin: auto;
}

/* Luxury Glass Card */
.login-card {
   background: var(--card-surface);
   backdrop-filter: blur(20px);
   -webkit-backdrop-filter: blur(20px);
   border-radius: 24px;
   border: 1px solid var(--glass-border);
   box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
               0 0 0 1px rgba(255, 255, 255, 0.05),
               inset 0 1px 1px rgba(255, 255, 255, 0.15);
   padding: 40px 36px 36px 36px;
   transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
   box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.65),
               0 0 40px -10px rgba(99, 102, 241, 0.25),
               inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

/* Header & Brand */
.login-brand-wrapper {
   text-align: center;
   margin-bottom: 28px;
}

.logo-badge {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   width: 82px;
   height: 82px;
   border-radius: 22px;
   background: rgba(255, 255, 255, 0.06);
   border: 1px solid rgba(255, 255, 255, 0.15);
   box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.35),
               inset 0 1px 2px rgba(255, 255, 255, 0.2);
   padding: 12px;
   margin-bottom: 16px;
   transition: transform 0.3s ease;
}

.logo-badge:hover {
   transform: scale(1.05) rotate(1deg);
}

.logo-badge img {
   max-width: 100%;
   max-height: 100%;
   object-fit: contain;
   filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.app-title {
   font-size: 1.55rem;
   font-weight: 700;
   letter-spacing: -0.02em;
   color: #ffffff;
   margin: 0 0 4px 0;
   text-transform: capitalize;
}

.app-subtitle {
   font-size: 0.86rem;
   color: var(--text-muted);
   font-weight: 400;
   margin: 0;
}

/* Staging Badge */
.staging-pill {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   background: rgba(234, 179, 8, 0.15);
   border: 1px solid rgba(234, 179, 8, 0.35);
   color: #fde047;
   font-size: 0.72rem;
   font-weight: 700;
   letter-spacing: 0.1em;
   text-transform: uppercase;
   padding: 4px 12px;
   border-radius: 9999px;
   margin-top: 10px;
}

.staging-pill .status-dot {
   width: 6px;
   height: 6px;
   border-radius: 50%;
   background-color: #eab308;
   box-shadow: 0 0 8px #eab308;
   animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
   0%, 100% { opacity: 1; transform: scale(1); }
   50% { opacity: 0.4; transform: scale(0.85); }
}

/* Divider Line */
.luxury-divider {
   height: 1px;
   background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
   margin: 24px 0 26px 0;
}

/* Form Styles */
.form-group-custom {
   margin-bottom: 20px;
   text-align: left;
}

.form-label-custom {
   display: block;
   font-size: 0.82rem;
   font-weight: 600;
   color: #cbd5e1;
   margin-bottom: 8px;
   letter-spacing: 0.02em;
}

.input-wrapper {
   position: relative;
   display: flex;
   align-items: center;
}

.input-icon {
   position: absolute;
   left: 16px;
   color: #64748b;
   font-size: 0.95rem;
   pointer-events: none;
   transition: color 0.2s ease;
}

.input-custom {
   width: 100%;
   padding: 13px 44px 13px 44px;
   background: var(--input-bg);
   border: 1px solid var(--input-border);
   border-radius: 14px;
   color: #ffffff;
   font-size: 0.92rem;
   outline: none;
   transition: all 0.25s ease;
   box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.input-custom:focus {
   border-color: #6366f1;
   background: rgba(15, 23, 42, 0.85);
   box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.input-custom:focus + .input-icon,
.input-custom:focus ~ .input-icon {
   color: #818cf8;
}

.toggle-password {
   position: absolute;
   right: 14px;
   background: none;
   border: none;
   color: #64748b;
   cursor: pointer;
   padding: 6px 8px;
   font-size: 0.95rem;
   transition: color 0.2s ease;
}

.toggle-password:hover {
   color: #cbd5e1;
}

/* Alert Notification */
.login-alert {
   min-height: 24px;
   font-size: 0.83rem;
   border-radius: 10px;
   transition: all 0.3s ease;
   display: none;
   align-items: center;
   gap: 8px;
   padding: 10px 14px;
   margin-bottom: 18px;
   background: rgba(239, 68, 68, 0.12);
   border: 1px solid rgba(239, 68, 68, 0.3);
   color: #fca5a5;
   text-align: left;
}

.login-alert.show-alert {
   display: flex;
   animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
   from { opacity: 0; transform: translateY(-6px); }
   to { opacity: 1; transform: translateY(0); }
}

/* Luxury Button */
.btn-submit {
   width: 100%;
   padding: 13px 20px;
   background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
   border: 1px solid rgba(255, 255, 255, 0.15);
   border-radius: 14px;
   color: #ffffff;
   font-size: 0.96rem;
   font-weight: 600;
   letter-spacing: 0.02em;
   cursor: pointer;
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 10px;
   box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.45),
               inset 0 1px 1px rgba(255, 255, 255, 0.25);
   transition: all 0.25s ease;
   position: relative;
   overflow: hidden;
}

.btn-submit::after {
   content: '';
   position: absolute;
   top: 0;
   left: -100%;
   width: 100%;
   height: 100%;
   background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
   transition: left 0.6s ease;
}

.btn-submit:hover {
   transform: translateY(-2px);
   box-shadow: 0 14px 26px -6px rgba(79, 70, 229, 0.6),
               inset 0 1px 1px rgba(255, 255, 255, 0.35);
   background: linear-gradient(135deg, #6d70f7 0%, #5850ec 50%, #493ecb 100%);
}

.btn-submit:hover::after {
   left: 100%;
}

.btn-submit:active {
   transform: translateY(0);
   box-shadow: 0 6px 14px -3px rgba(79, 70, 229, 0.4);
}

.btn-submit:disabled {
   opacity: 0.7;
   cursor: not-allowed;
   transform: none;
}

/* Spinner */
.spinner-luxury {
   display: none;
   width: 18px;
   height: 18px;
   border: 2px solid rgba(255, 255, 255, 0.3);
   border-radius: 50%;
   border-top-color: #ffffff;
   animation: spin 0.8s linear infinite;
}

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

/* Footer / Watermark */
.login-footer {
   text-align: center;
   margin-top: 24px;
   font-size: 0.76rem;
   color: #64748b;
   letter-spacing: 0.02em;
}

.login-footer span {
   color: #94a3b8;
   font-weight: 500;
}

/* Responsive adjustments */
@media screen and (max-width: 480px) {
   .login-card {
      padding: 30px 22px 26px 22px;
      border-radius: 20px;
   }
   .logo-badge {
      width: 72px;
      height: 72px;
      border-radius: 18px;
   }
   .app-title {
      font-size: 1.35rem;
   }
}
