﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #0d1b2e; /* Absolutely prevents white background flashes */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: flex-start; /* Restores the original left-side layout */
    align-items: center;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    background: url(/Content/images/home/loginBack.png) no-repeat center center fixed, linear-gradient(135deg, #0a1628 0%, #1a2942 50%, #0d1b2e 100%) fixed;
    background-size: cover;
    color: white;
}

    body::before {
        content: '';
        position: fixed;
        width: min(500px, 50vw);
        height: min(500px, 50vw);
        background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
        border-radius: 50%;
        top: -250px;
        right: -250px;
        animation: pulse 8s ease-in-out infinite;
        z-index: 0;
    }

    body::after {
        content: '';
        position: fixed;
        width: min(400px, 40vw);
        height: min(400px, 40vw);
        background: radial-gradient(circle, rgba(96, 165, 250, 0.1) 0%, transparent 70%);
        border-radius: 50%;
        bottom: -200px;
        left: -200px;
        animation: pulse 6s ease-in-out infinite reverse;
        z-index: 0;
    }

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wave-pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
}

.login-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    color: #313a46;
    width: 65vw;
    height: auto;
    min-height: 464px;
    overflow-y: auto;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 100px rgba(59, 130, 246, 0.1);
    animation: scaleIn 0.6s ease-out;
    margin-left: 4vw;
    margin-top: 40px;
    margin-bottom: 40px;
}

    .login-wrapper::-webkit-scrollbar {
        width: 8px;
    }

    .login-wrapper::-webkit-scrollbar-track {
        background: transparent;
    }

    .login-wrapper::-webkit-scrollbar-thumb {
        background: rgba(59, 130, 246, 0.3);
        border-radius: 4px;
    }

/* Left Panel */
.login-left {
    flex: 1; /* Works properly horizontally for desktop */
    background: linear-gradient(135deg, rgba(10, 22, 40, 0.8) 0%, rgba(15, 23, 42, 0.9) 50%, rgba(10, 22, 40, 0.8) 100%);
    padding: clamp(20px, 4vh, 60px) clamp(20px, 3vw, 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-right: 1px solid rgba(59, 130, 246, 0.2);
    position: relative;
    animation: fadeInLeft 0.8s ease-out 0.2s both;
    overflow: hidden;
    opacity: 0.95 !important;
}

/* Base Desktop Tower RESTORED!! */
.tower {
    position: absolute;
    width: 80px;
    height: clamp(300px, 50vh, 500px);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.4;
    pointer-events: none;
}

.support-1 {
    top: 30%;
}

.support-2 {
    top: 50%;
}

.support-3 {
    top: 70%;
}

.signal-wave {
    position: absolute;
    width: clamp(40px, 8vh, 60px);
    height: clamp(40px, 8vh, 60px);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.signal-wave-1 {
    top: 15%;
    left: 15%;
    animation: wave-pulse 3s ease-in-out infinite;
}

.signal-wave-2 {
    top: 20%;
    right: 20%;
    animation: wave-pulse 3s ease-in-out 0.5s infinite;
}

.signal-wave-3 {
    bottom: 25%;
    left: 20%;
    animation: wave-pulse 3s ease-in-out 1s infinite;
}

.signal-wave-4 {
    bottom: 20%;
    right: 15%;
    animation: wave-pulse 3s ease-in-out 1.5s infinite;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-icon {
    width: clamp(70px, 12vh, 100px);
    height: clamp(70px, 12vh, 100px);
    border-radius: clamp(15px, 2vw, 30px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto clamp(10px, 3vh, 30px);
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.4);
    animation: scaleIn 0.8s ease-out 0.4s both;
    background: linear-gradient(135deg, #434f65 0%, #6d88a9 100%);
}

    .hero-icon img {
        width: 60%;
        height: 60%;
        object-fit: contain; /* Guarantees no stretching or distortion */
    }

.hero-title {
    font-size: clamp(24px, 4vh, 42px);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: clamp(10px, 2vh, 20px);
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.hero-subtitle {
    font-size: clamp(13px, 1.8vh, 16px);
    color: #94a3b8;
    line-height: 1.5;
    max-width: 400px;
    margin: 0 auto clamp(15px, 4vh, 40px);
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.feature-list {
    text-align: left;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.5vh, 15px);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #cbd5e1;
    font-size: clamp(13px, 1.8vh, 16px);
    animation: fadeInLeft 0.6s ease-out both;
}

    .feature-item:nth-child(1) {
        animation-delay: 0.7s;
    }

    .feature-item:nth-child(2) {
        animation-delay: 0.8s;
    }

    .feature-item:nth-child(3) {
        animation-delay: 0.9s;
    }

    .feature-item:nth-child(4) {
        animation-delay: 1s;
    }

.feature-icon {
    width: clamp(25px, 4vh, 35px);
    height: clamp(25px, 4vh, 35px);
    background: rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: clamp(14px, 2vh, 18px);
}

    .feature-icon img {
        filter: invert(100%) sepia(100%) saturate(0%) hue-rotate(312deg) brightness(103%) contrast(103%);
        max-width: 60%;
        max-height: 60%;
    }

/* Right Panel */
.login-container {
    flex: 1; /* Works properly horizontally for desktop */
    padding: clamp(20px, 4vh, 60px) clamp(20px, 4vw, 50px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    animation: fadeInRight 0.8s ease-out 0.2s both;
    background-color: #ecedf1;
    opacity: 0.90 !important;
}

.welcome-title {
    color: #000;
    margin-bottom: clamp(5px, 1vh, 12px);
    font-size: clamp(24px, 4vh, 38px);
    font-weight: 700;
    animation: slideIn 0.6s ease-out 0.4s both;
}

.mfa-title {
    font-size: clamp(20px, 3vh, 26px);
}

.adaptive-margin {
    margin: 0px 0px clamp(15px, 3vh, 40px) 0px;
}

.login-container .subtitle {
    color: #313a46;
    font-size: clamp(14px, 2vh, 16px);
    animation: slideIn 0.6s ease-out 0.5s both;
}

.form-group {
    animation: fadeInUp 0.6s ease-out both;
}

    .form-group:nth-of-type(1) {
        animation-delay: 0.6s;
    }

    .form-group:nth-of-type(2) {
        animation-delay: 0.7s;
    }

    .form-group label {
        display: block;
        color: #313a46;
        margin-bottom: clamp(5px, 1vh, 10px);
        font-size: clamp(13px, 1.8vh, 14px);
        font-weight: 500;
    }

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 16px;
}

input[type="text"], input[type="password"] {
    width: 100%;
    padding: clamp(10px, 1.5vh, 14px) 14px clamp(10px, 1.5vh, 14px) 42px;
    background: #ecedf1 !important;
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 8px;
    color: #000 !important;
    font-size: clamp(14px, 2vh, 16px);
    transition: all 0.3s ease;
    outline: none;
    margin: 5px 0px clamp(10px, 2vh, 15px) 0px;
    background-image: url(/Content/images/NewDesignIcons/user.svg) !important;
    background-size: 18px !important;
    background-repeat: no-repeat !important;
    background-position: 12px !important;
}

    input[type="text"]:focus, input[type="password"]:focus {
        background: rgba(236, 237, 241, 1);
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

input[type="password"] {
    background-image: url(/Content/images/NewDesignIcons/unlock.svg) !important;
}

input::placeholder {
    color: #64748b;
    font-size: clamp(13px, 1.8vh, 15px);
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(15px, 3vh, 25px);
    animation: fadeInUp 0.6s ease-out 0.8s both;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .remember-me input[type="checkbox"] {
        width: 16px;
        height: 16px;
        cursor: pointer;
        accent-color: #3b82f6;
    }

    .remember-me label {
        margin: 0;
        cursor: pointer;
        font-size: clamp(13px, 1.8vh, 14px);
        color: #313a46;
    }

input[type="submit"], .login-btn {
    width: 100%;
    padding: clamp(12px, 2vh, 15px);
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: clamp(14px, 2vh, 16px);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    animation: fadeInUp 0.6s ease-out 0.9s both;
    margin-top: clamp(10px, 2.5vh, 20px);
}

.text-danger, .Error {
    color: #ef4444;
    font-size: clamp(12px, 1.8vh, 14px);
    margin: 5px 0px;
    display: block;
}

.app-store-images {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: clamp(15px, 3vh, 20px);
    animation: fadeInUp 0.6s ease-out 1.2s both;
}

    .app-store-images img {
        width: clamp(120px, 15vw, 150px);
        cursor: pointer;
    }

/* MFA Layout Support */
.mfa-container {
    padding: clamp(10px, 2vw, 20px);
    color: #313a46 !important;
}

    .mfa-container h2 {
        color: #313a46 !important;
        margin-bottom: clamp(10px, 2vh, 20px);
        padding: 5px 0px !important;
    }

    .mfa-container p, .mfa-container div {
        color: #313a46;
        font-size: clamp(13px, 1.8vh, 15px);
        line-height: 1.5;
        margin-bottom: clamp(10px, 1.5vh, 15px);
    }

    .mfa-container .qr-code {
        text-align: center;
        margin: 10px 0;
    }

        .mfa-container .qr-code img {
            border-radius: 8px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
            height: clamp(90px, 15vh, 130px) !important;
        }

table {
    width: 100%;
    border-collapse: collapse;
}

    table td {
        padding: 0;
    }

span[id*="Required"] {
    color: #ef4444;
    margin-left: 5px;
}

/* ----------------------------------------------------
   RESPONSIVE MEDIA QUERIES
------------------------------------------------------- */
@media (max-width: 992px) {
    body {
        padding: 15px;
    }

    .login-wrapper {
        flex-direction: column;
        width: 100%;
        max-width: 500px;
        margin-left: auto; /* Re-center when on small devices */
        margin-right: auto;
    }

    .login-left {
        flex: none; /* FIX: Critical for proper vertical stacking heights! */
        padding: clamp(20px, 3vh, 30px) 15px;
        border-right: none;
        border-bottom: 1px solid rgba(59, 130, 246, 0.3);
    }

    .login-container {
        flex: none; /* FIX: Critical for proper vertical stacking heights! */
        padding: clamp(20px, 3vh, 40px) 25px;
    }

    .tower, .signal-wave {
        display: none;
    }
    /* Only disable graphics on tight tablet/mobile bounds */

    .hero-icon {
        margin-bottom: clamp(10px, 2vh, 15px);
    }

    .feature-list {
        display: flex;
        flex-wrap: wrap;
        flex-direction: row;
        gap: 8px;
        justify-content: center;
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .login-wrapper {
        margin: 0 auto;
        max-height: 95vh;
        border-radius: 12px;
    }

    .hero-title {
        font-size: 24px;
        margin-bottom: 5px;
    }

    .hero-subtitle {
        font-size: 13px;
    }

    .login-container {
        padding: 25px 20px;
    }

    .feature-list {
        display: none;
    }

    .app-store-images {
        flex-direction: row;
    }
}
