/**
 * Premium fintech auth / login UI — animations in external CSS only.
 */

:root {
    --auth-primary: #2563eb;
    --auth-accent: #7c3aed;
    --auth-cyan: #06b6d4;
    --auth-dark: #0f172a;
    --auth-glass: rgba(255, 255, 255, 0.72);
    --auth-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-login-page {
    font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ─── Animated hero panel ─── */
.auth-login-hero {
    position: relative;
    color: #fff;
    background: linear-gradient(-45deg, #0f172a, #1e1b4b, #1e3a8a, #0369a1, #0e7490);
    background-size: 400% 400%;
    animation: auth-gradient-flow 14s ease infinite;
}

@keyframes auth-gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.auth-hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
    pointer-events: none;
}

.auth-hero-orbs,
.auth-panel-orbs {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    animation: auth-orb-float 10s var(--auth-ease-out) infinite;
}

.auth-orb-1 {
    width: 320px;
    height: 320px;
    background: #3b82f6;
    top: -8%;
    left: -5%;
    animation-duration: 12s;
}

.auth-orb-2 {
    width: 280px;
    height: 280px;
    background: #8b5cf6;
    bottom: 10%;
    right: -8%;
    animation-delay: -3s;
    animation-duration: 14s;
}

.auth-orb-3 {
    width: 200px;
    height: 200px;
    background: #22d3ee;
    top: 45%;
    left: 35%;
    animation-delay: -6s;
    animation-duration: 11s;
}

.auth-panel-orbs .auth-orb-1 {
    width: 220px;
    height: 220px;
    background: #93c5fd;
    opacity: 0.35;
    top: 5%;
    right: 10%;
    left: auto;
}

.auth-panel-orbs .auth-orb-2 {
    width: 180px;
    height: 180px;
    background: #c4b5fd;
    opacity: 0.3;
    bottom: 15%;
    left: 5%;
}

@keyframes auth-orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(24px, -20px) scale(1.06); }
    66% { transform: translate(-16px, 14px) scale(0.94); }
}

.auth-hero-content {
    position: relative;
    z-index: 2;
}

.auth-hero-title {
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.letter-spacing-wide {
    letter-spacing: 0.12em;
}

.auth-service-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 2rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
    transition: transform 0.3s var(--auth-ease-out), background 0.3s ease;
}

.auth-service-chip:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.16);
}

.auth-mini-service {
    background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%);
    border: 1px solid #e2e8f0;
    transition: transform 0.25s var(--auth-ease-out), box-shadow 0.25s ease, border-color 0.25s ease;
}

.auth-mini-service:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.auth-mini-service i {
    font-size: 1.1rem;
}

.auth-login-services {
    margin-top: -0.25rem;
}

.auth-hero-title span {
    background: linear-gradient(90deg, #fff 0%, #a5f3fc 50%, #c4b5fd 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: auth-text-shine 5s linear infinite;
}

@keyframes auth-text-shine {
    to { background-position: 200% center; }
}

.auth-hero-feature {
    opacity: 0;
    animation: auth-slide-in-left 0.7s var(--auth-ease-out) forwards;
}

.auth-hero-feature:nth-child(1) { animation-delay: 0.35s; }
.auth-hero-feature:nth-child(2) { animation-delay: 0.5s; }
.auth-hero-feature:nth-child(3) { animation-delay: 0.65s; }

@keyframes auth-slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.auth-hero-feature .hero-feature-icon {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    flex-shrink: 0;
    transition: transform 0.35s var(--auth-ease-out), background 0.35s ease;
}

.auth-hero-feature:hover .hero-feature-icon {
    transform: scale(1.08) rotate(-3deg);
    background: rgba(255, 255, 255, 0.18);
}

.auth-stat-card {
    padding: 1rem 1.125rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    opacity: 0;
    animation: auth-fade-up 0.8s var(--auth-ease-out) forwards;
}

.auth-hero-stats .col:nth-child(1) .auth-stat-card { animation-delay: 0.75s; }
.auth-hero-stats .col:nth-child(2) .auth-stat-card { animation-delay: 0.9s; }
.auth-hero-stats .col:nth-child(3) .auth-stat-card { animation-delay: 1.05s; }

.auth-stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
}

.auth-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.7;
}

/* ─── Form panel ─── */
.auth-login-panel {
    position: relative;
    background: linear-gradient(160deg, #f8fafc 0%, #eef2ff 45%, #f0f9ff 100%);
    min-height: 100vh;
}

.auth-mobile-hero {
    display: none;
    background: linear-gradient(135deg, #1e3a8a, #4f46e5);
    color: #fff;
    padding: 1.25rem 1.5rem;
    text-align: center;
}

@media (max-width: 991.98px) {
    .auth-mobile-hero {
        display: block;
        animation: auth-fade-up 0.6s var(--auth-ease-out);
    }
}

.auth-login-form-wrap {
    max-width: 26rem;
    position: relative;
    z-index: 2;
}

.auth-login-card {
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: var(--auth-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.5) inset,
        0 25px 50px -12px rgba(15, 23, 42, 0.18),
        0 0 80px -20px rgba(37, 99, 235, 0.25);
    opacity: 0;
    animation: auth-card-enter 0.9s var(--auth-ease-out) 0.15s forwards;
    overflow: hidden;
}

.auth-login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--auth-primary), var(--auth-accent), var(--auth-cyan), var(--auth-primary));
    background-size: 300% 100%;
    animation: auth-border-flow 4s linear infinite;
}

@keyframes auth-border-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

@keyframes auth-card-enter {
    from {
        opacity: 0;
        transform: translateY(28px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-login-card .card-body {
    padding: 2rem 1.75rem 1.75rem;
}

@media (min-width: 768px) {
    .auth-login-card .card-body {
        padding: 2.25rem 2.25rem 2rem;
    }
}

.auth-login-logo {
    max-height: 2.75rem;
    width: auto;
    object-fit: contain;
}

.auth-login-icon-wrap {
    position: relative;
    width: 4.5rem;
    height: 4.5rem;
    margin-left: auto;
    margin-right: auto;
}

.auth-login-icon-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--auth-primary);
    border-right-color: var(--auth-accent);
    animation: auth-spin 2.5s linear infinite;
}

.auth-login-icon-ring::after {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-bottom-color: var(--auth-cyan);
    border-left-color: #a78bfa;
    animation: auth-spin 3.5s linear infinite reverse;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

.auth-login-icon-inner {
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff, #ede9fe);
    color: var(--auth-primary);
    font-size: 1.5rem;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2);
}

.auth-login-title {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--auth-dark);
    margin-bottom: 0.35rem;
}

.auth-guard-pill {
    display: inline-block;
    padding: 0.3em 0.9em;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 2rem;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-accent));
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    animation: auth-pill-pulse 3s ease-in-out infinite;
}

@keyframes auth-pill-pulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35); }
    50% { box-shadow: 0 4px 22px rgba(124, 58, 237, 0.45); }
}

/* Staggered form items */
.auth-login-animate {
    opacity: 0;
    animation: auth-fade-up 0.65s var(--auth-ease-out) forwards;
}

.auth-login-animate-delay-1 { animation-delay: 0.35s; }
.auth-login-animate-delay-2 { animation-delay: 0.45s; }
.auth-login-animate-delay-3 { animation-delay: 0.55s; }
.auth-login-animate-delay-4 { animation-delay: 0.65s; }
.auth-login-animate-delay-5 { animation-delay: 0.75s; }
.auth-login-animate-delay-6 { animation-delay: 0.85s; }
.auth-login-animate-delay-7 { animation-delay: 0.95s; }

@keyframes auth-fade-up {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-field-shell {
    border-radius: 0.875rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e2e8f0;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s var(--auth-ease-out);
}

.auth-field-shell:hover {
    border-color: #cbd5e1;
}

.auth-field-shell:focus-within {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
    transform: translateY(-2px);
}

.auth-field-shell.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
    animation: auth-shake 0.45s ease;
}

@keyframes auth-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.auth-field-shell .input-group-text {
    background: transparent;
    border: 0;
    color: #94a3b8;
    padding-left: 1.125rem;
    transition: color 0.3s ease;
}

.auth-field-shell:focus-within .input-group-text {
    color: var(--auth-primary);
}

.auth-field-shell .form-control {
    border: 0;
    background: transparent;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
    font-size: 1rem;
}

.auth-field-shell .form-control:focus {
    box-shadow: none;
}

.auth-field-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.45rem;
}

.auth-field-shell .btn-toggle-password {
    border: 0;
    background: transparent;
    color: #94a3b8;
    padding-right: 1rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.auth-field-shell .btn-toggle-password:hover {
    color: var(--auth-primary);
    transform: scale(1.1);
}

.auth-login-form .form-check-input:checked {
    background-color: var(--auth-primary);
    border-color: var(--auth-primary);
}

.auth-btn-login {
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: 0.875rem;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #7c3aed 100%);
    background-size: 200% auto;
    box-shadow: 0 10px 28px -8px rgba(37, 99, 235, 0.55);
    transition: transform 0.25s var(--auth-ease-out), box-shadow 0.3s ease, background-position 0.4s ease;
}

.auth-btn-login::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 70%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    animation: auth-shimmer 2.8s ease-in-out infinite;
}

@keyframes auth-shimmer {
    0% { left: -120%; }
    55%, 100% { left: 140%; }
}

.auth-btn-login:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px -10px rgba(79, 70, 229, 0.55);
    background-position: right center;
}

.auth-btn-login:not(:disabled):active {
    transform: translateY(-1px);
}

.auth-btn-login:disabled {
    opacity: 0.88;
    cursor: wait;
}

.auth-trust-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1rem;
}

.auth-trust-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.auth-trust-badge i {
    color: #10b981;
}

.auth-login-footer {
    border-color: rgba(226, 232, 240, 0.8) !important;
}

.auth-forgot-link {
    transition: color 0.2s ease, transform 0.2s ease;
}

.auth-forgot-link:hover {
    transform: translateX(2px);
}

@media (prefers-reduced-motion: reduce) {
    .auth-login-hero,
    .auth-orb,
    .auth-login-icon-ring,
    .auth-login-icon-ring::after,
    .auth-login-card::before,
    .auth-btn-login::after,
    .auth-guard-pill,
    .auth-hero-title span,
    .auth-login-animate,
    .auth-hero-feature,
    .auth-stat-card,
    .auth-login-card {
        animation: none !important;
    }

    .auth-login-card,
    .auth-login-animate,
    .auth-hero-feature,
    .auth-stat-card {
        opacity: 1;
        transform: none;
    }
}
