/* ============================================
   SPLASH SCREEN / LOADING OVERLAY
   Shows on page load, hides after auth check
   ============================================ */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f0ff 0%, #e8e6ff 50%, #f5f0ff 100%);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.splash-screen.fade-out {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

/* Spinner — Orbital ring animation */
.splash-spinner {
    width: 56px;
    height: 56px;
    position: relative;
    margin-bottom: 28px;
}

.splash-spinner .ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2.5px solid transparent;
}

.splash-spinner .ring:nth-child(1) {
    border-top-color: #6366f1;
    animation: spinOrbit 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.splash-spinner .ring:nth-child(2) {
    border-right-color: #818cf8;
    animation: spinOrbit 1.3s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite reverse;
    inset: 5px;
}

.splash-spinner .ring:nth-child(3) {
    border-bottom-color: #a78bfa;
    animation: spinOrbit 1.6s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    inset: 10px;
}

.splash-spinner .core {
    position: absolute;
    inset: 16px;
    border-radius: 50%;
    background: radial-gradient(circle, #818cf8 0%, #6366f1 60%, #4f46e5 100%);
    animation: corePulse 1.2s ease-in-out infinite alternate;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

@keyframes corePulse {
    from {
        transform: scale(0.85);
        opacity: 0.7;
    }

    to {
        transform: scale(1.1);
        opacity: 1;
    }
}

.splash-brand {
    font-size: 18px;
    font-weight: 700;
    color: #334155;
    letter-spacing: 0.5px;
}

.splash-brand span {
    color: #6366f1;
}

.splash-status {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: statusPulse 1.5s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

/* ============================================
   LOGIN PAGE — BRIGHT THEME with FLOATING ICONS
   ============================================ */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f7ff 0%, #eef0ff 40%, #f0edff 70%, #f5f3ff 100%);
    overflow: hidden;
    padding: 20px;
}

.login-overlay.hidden {
    display: none;
}

/* Soft decorative blobs */
.login-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-bg::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    top: -15%;
    right: -10%;
    animation: blobFloat 15s ease-in-out infinite;
}

.login-bg::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.06) 0%, transparent 70%);
    bottom: -10%;
    left: -5%;
    animation: blobFloat 20s ease-in-out infinite reverse;
}

@keyframes blobFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -20px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 15px) scale(0.95);
    }
}

/* Subtle grid */
.login-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* ===== FLOATING BUSINESS ICONS ===== */
.login-float-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: iconFloat ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

/* Individual icon positions, colors, sizes, and animation speeds */
/* 📦 Package / Order */
.login-float-icon:nth-child(3) {
    width: 56px;
    height: 56px;
    font-size: 22px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.12);
    color: #6366f1;
    top: 12%;
    left: 8%;
    animation-duration: 6s;
    transform: rotate(-12deg);
}

/* 🚚 Shipping / Delivery */
.login-float-icon:nth-child(4) {
    width: 50px;
    height: 50px;
    font-size: 20px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.12);
    color: #10b981;
    top: 8%;
    right: 12%;
    animation-duration: 7s;
    animation-delay: 0.5s;
    transform: rotate(8deg);
}

/* 📊 Analytics / Marketing */
.login-float-icon:nth-child(5) {
    width: 48px;
    height: 48px;
    font-size: 19px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    bottom: 20%;
    left: 6%;
    animation-duration: 8s;
    animation-delay: 1s;
    transform: rotate(15deg);
}

/* 💰 Finance / Profit */
.login-float-icon:nth-child(6) {
    width: 52px;
    height: 52px;
    font-size: 21px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.12);
    color: #22c55e;
    bottom: 15%;
    right: 8%;
    animation-duration: 6.5s;
    animation-delay: 0.3s;
    transform: rotate(-8deg);
}

/* 🎯 Advertiser / Target */
.login-float-icon:nth-child(7) {
    width: 44px;
    height: 44px;
    font-size: 17px;
    background: rgba(239, 68, 68, 0.07);
    border: 1px solid rgba(239, 68, 68, 0.1);
    color: #ef4444;
    top: 35%;
    left: 3%;
    animation-duration: 7.5s;
    animation-delay: 2s;
    transform: rotate(20deg);
}

/* 🎧 Customer Service */
.login-float-icon:nth-child(8) {
    width: 46px;
    height: 46px;
    font-size: 18px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    top: 25%;
    right: 5%;
    animation-duration: 9s;
    animation-delay: 1.5s;
    transform: rotate(-15deg);
}

/* 📈 Growth / Trending */
.login-float-icon:nth-child(9) {
    width: 42px;
    height: 42px;
    font-size: 16px;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.1);
    color: #a855f7;
    bottom: 35%;
    right: 3%;
    animation-duration: 8.5s;
    animation-delay: 0.8s;
    transform: rotate(10deg);
}

/* 🛒 Shopping / Cart */
.login-float-icon:nth-child(10) {
    width: 40px;
    height: 40px;
    font-size: 15px;
    background: rgba(236, 72, 153, 0.07);
    border: 1px solid rgba(236, 72, 153, 0.1);
    color: #ec4899;
    bottom: 8%;
    left: 15%;
    animation-duration: 7s;
    animation-delay: 2.5s;
    transform: rotate(-5deg);
}

/* 💳 Wallet / Payment */
.login-float-icon:nth-child(11) {
    width: 38px;
    height: 38px;
    font-size: 14px;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
    top: 55%;
    left: 10%;
    animation-duration: 10s;
    animation-delay: 3s;
    transform: rotate(18deg);
}

/* 📱 Digital / Mobile */
.login-float-icon:nth-child(12) {
    width: 36px;
    height: 36px;
    font-size: 14px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.08);
    color: #818cf8;
    top: 60%;
    right: 10%;
    animation-duration: 8s;
    animation-delay: 1.2s;
    transform: rotate(-20deg);
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0) rotate(var(--r, 0deg));
    }

    50% {
        transform: translateY(-18px) rotate(calc(var(--r, 0deg) + 5deg));
    }
}

/* ===== Login Card — Clean Glass ===== */
.login-card {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 24px;
    padding: 44px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.7) inset,
        0 20px 60px rgba(99, 102, 241, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.04);
    animation: cardAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
        filter: blur(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Accent gradient line at top */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #818cf8, #a78bfa, #818cf8, #6366f1);
    background-size: 200% 100%;
    border-radius: 0 0 3px 3px;
    animation: gradientSlide 4s linear infinite;
}

@keyframes gradientSlide {
    to {
        background-position: 200% 0;
    }
}

/* Logo */
.login-logo {
    text-align: center;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.login-logo .logo-icon {
    width: 56px !important;
    height: 56px !important;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
}

.login-logo h1 {
    margin: 0;
    font-size: 26px;
    color: #1e293b;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-logo h1 span {
    color: #6366f1;
}

.login-logo p {
    color: #94a3b8;
    font-size: 13px;
    margin: 0;
    letter-spacing: 0.3px;
}

/* Form fields */
.login-field {
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.login-field input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.8);
    color: #1e293b;
    outline: none;
}

.login-field input::placeholder {
    color: #94a3b8;
}

.login-field input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 2px 8px rgba(99, 102, 241, 0.06);
    background: #fff;
}

/* Login button */
.login-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 8px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
}

.login-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(255, 255, 255, 0.15) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: btnShimmer 3s ease-in-out infinite;
}

@keyframes btnShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.35);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Error message */
#login-error {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.12);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: 0.3px;
}

.login-footer a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.login-footer a:hover {
    color: #4f46e5;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .login-float-icon {
        opacity: 0.5;
        transform: scale(0.8) !important;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .login-logo .logo-icon {
        width: 48px !important;
        height: 48px !important;
    }

    .login-logo h1 {
        font-size: 22px;
    }

    .login-float-icon {
        display: none;
    }
}