/* ============================================================
   LOGIN PAGE - Premium Redesign
   Split-panel layout with animated branding & modern form
   ============================================================ */

/* --- Page Base --- */
body.login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0f172a;
    overflow-x: hidden;
}

.login-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ============================================================
   LEFT PANEL: Branding
   ============================================================ */
.login-brand-panel {
    width: 48%;
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 30%, #0f172a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 3rem 2rem;
}

/* Subtle grid overlay */
.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

/* --- Floating shapes --- */
.floating-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: floatShape 18s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    top: -80px;
    left: -80px;
    animation-delay: 0s;
    animation-duration: 20s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
    bottom: 10%;
    right: -40px;
    animation-delay: 3s;
    animation-duration: 22s;
}

.shape-3 {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    top: 40%;
    left: 20%;
    animation-delay: 6s;
    animation-duration: 16s;
}

.shape-4 {
    width: 80px;
    height: 80px;
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 16px;
    top: 20%;
    right: 20%;
    animation-delay: 2s;
    animation-duration: 24s;
    transform: rotate(45deg);
}

.shape-5 {
    width: 60px;
    height: 60px;
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: 12px;
    bottom: 25%;
    left: 15%;
    animation-delay: 8s;
    animation-duration: 19s;
    transform: rotate(30deg);
}

.shape-6 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
    top: 60%;
    right: 10%;
    animation-delay: 5s;
    animation-duration: 21s;
}

@keyframes floatShape {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }

    15% {
        opacity: 1;
    }

    50% {
        transform: translateY(-20px) scale(1.05);
    }

    85% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
}

/* --- Brand Content --- */
.brand-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    animation: brandFadeIn 1s ease-out 0.3s both;
}

@keyframes brandFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo Ring */
.brand-logo {
    margin-bottom: 2rem;
}

.logo-ring {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    animation: ringPulse 4s ease-in-out infinite;
}

.logo-ring::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1px solid rgba(99, 102, 241, 0.12);
    animation: ringRotate 12s linear infinite;
    border-top-color: rgba(139, 92, 246, 0.4);
}

@keyframes ringRotate {
    to {
        transform: rotate(360deg);
    }
}

@keyframes ringPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.2);
    }

    50% {
        box-shadow: 0 0 30px 10px rgba(99, 102, 241, 0.1);
    }
}

.logo-inner {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
    overflow: hidden;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    border-radius: 50%;
}

.logo-img-mobile {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-tagline {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    letter-spacing: 0.3px;
}

.brand-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 4px;
    margin: 1.8rem auto;
}

/* Feature Items */
.brand-features {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    opacity: 0;
    animation: featureFadeIn 0.6s ease-out forwards;
}

.feature-item:nth-child(1) {
    animation-delay: 0.8s;
}

.feature-item:nth-child(2) {
    animation-delay: 1s;
}

.feature-item:nth-child(3) {
    animation-delay: 1.2s;
}

@keyframes featureFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #a5b4fc;
    transition: all 0.3s ease;
}



.feature-item span {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.brand-footer {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 2;
}

.brand-footer p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.2);
    margin: 0;
}

/* ============================================================
   RIGHT PANEL: Login Form
   ============================================================ */
.login-form-panel {
    width: 52%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
}

/* Decorative corner accent */
.login-form-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.form-wrapper {
    width: 100%;
    max-width: 420px;
}

/* Mobile Brand (hidden on desktop) */
.mobile-brand {
    display: none;
    text-align: center;
    margin-bottom: 2rem;
}

.mobile-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
    margin: 0 auto 0.8rem;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
    overflow: hidden;
}

.mobile-brand h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

/* --- Form Header --- */
.form-header {
    margin-bottom: 2.5rem;
}

.form-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.5rem;
    letter-spacing: -0.3px;
}

.form-subtitle {
    font-size: 0.95rem;
    color: #94a3b8;
    font-weight: 400;
    margin: 0;
}

/* --- Form Groups --- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label-pro {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

/* --- Input Wrapper --- */
.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: #94a3b8;
    transition: color 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.input-pro {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.input-pro::placeholder {
    color: #b0bec5;
    font-weight: 400;
}

.input-pro:hover {
    border-color: #cbd5e1;
    background: #ffffff;
}

.input-pro:focus {
    border-color: #6366f1;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.input-pro:focus~.input-focus-border {
    transform: scaleX(1);
}

.input-wrapper:focus-within .input-icon {
    color: #6366f1;
}

/* Animated focus border */
.input-focus-border {
    position: absolute;
    bottom: 0;
    left: 12px;
    right: 12px;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 2px;
    transform: scaleX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
}

/* --- Password Toggle --- */
.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 6px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    z-index: 5;
    border-radius: 6px;
}

.toggle-password:hover {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.06);
}

/* --- Login Button --- */
.btn-login {
    width: 100%;
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 50%, #8b5cf6 100%);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
}

.btn-login-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    position: relative;
    z-index: 2;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
}

.btn-login:active {
    transform: translateY(0px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Shine animation on button */
.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: none;
    z-index: 1;
}

.btn-login:hover .btn-shine {
    animation: shineSlide 0.6s ease forwards;
}

@keyframes shineSlide {
    to {
        left: 100%;
    }
}

/* Loading state for login button */
.btn-login.btn-loading {
    pointer-events: none;
    opacity: 0.8;
}

/* Override: remove duplicate spinner from style.css ::after */
.btn-login.btn-loading::after {
    content: none !important;
    display: none !important;
}

.btn-login.btn-loading .btn-spinner {
    display: inline-block !important;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
}

/* --- Login Footer --- */
.login-footer {
    margin-top: 2rem;
    text-align: center;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: #f1f5f9;
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
}

.security-badge i {
    color: #22c55e;
    font-size: 0.85rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
    .login-brand-panel {
        width: 42%;
        padding: 2rem 1.5rem;
    }

    .login-form-panel {
        width: 58%;
        padding: 2rem;
    }

    .brand-title {
        font-size: 1.8rem;
    }

    .brand-features {
        gap: 1.2rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }

    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        width: 100%;
        min-height: 100vh;
        padding: 2rem 1.5rem;
        background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    }

    .mobile-brand {
        display: block;
    }

    .form-wrapper {
        max-width: 380px;
        margin: 0 auto;
    }

    .form-title {
        font-size: 1.5rem;
        text-align: center;
    }

    .form-subtitle {
        text-align: center;
    }

    .form-header {
        margin-bottom: 2rem;
    }
}

/* Small Mobile */
@media (max-width: 400px) {
    .login-form-panel {
        padding: 1.5rem 1rem;
    }

    .form-title {
        font-size: 1.3rem;
    }

    .input-pro {
        padding: 0.75rem 1rem 0.75rem 2.6rem;
        font-size: 0.9rem;
    }

    .btn-login {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }
}