/* Modern Login Page CSS with Precision Dipper & Highlighted Bilty360 Branding */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

body, html {
    height: 100%;
    margin: 0;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
}

.login-container {
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
}

@media (min-width: 992px) {
    .login-container {
        justify-content: flex-end;
        padding-right: 7vw;
    }
}

/* ========================================================
   BACKGROUND TRUCK SCENE & PRECISION DIPPER LIGHT SYSTEM
   ======================================================== */
.login-bg-viewport {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #0c121e;
}

.truck-scene {
    position: relative;
    /* Mathematical 1:1 aspect ratio pinned to the 1024x1024 background image */
    width: max(100vw, 100vh);
    height: max(100vw, 100vh);
    flex-shrink: 0;
    user-select: none;
    pointer-events: none;
}

.truck-bg-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: fill;
}

/* Headlight Dipper Bulbs (Intense Xenon / Halogen High-Beam Glow) */
.truck-dipper {
    position: absolute;
    border-radius: 50%;
    z-index: 3;
    pointer-events: none;
    background: radial-gradient(circle, #ffffff 30%, #fef08a 70%, rgba(250, 204, 21, 0.4) 100%);
    animation: truckDipperFlasher 4.2s ease-in-out infinite;
}

/* Left Headlight (Hexagonal LED bracket) */
.dipper-left {
    top: 60.5%;
    left: 26.0%;
    width: 2.0%;
    height: 2.0%;
    transform-origin: center;
}

/* Right Headlight (Bracket LED) */
.dipper-right {
    top: 60.8%;
    left: 41.5%;
    width: 2.0%;
    height: 2.0%;
    transform-origin: center;
}

/* Lower Fog Lights */
.dipper-fog-left {
    top: 64.6%;
    left: 26.4%;
    width: 1.2%;
    height: 1.2%;
    opacity: 0.8;
}

.dipper-fog-right {
    top: 64.7%;
    left: 42.1%;
    width: 1.2%;
    height: 1.2%;
    opacity: 0.8;
}

/* Horizontal Grill Light Bar Glow */
.truck-dipper-strip {
    position: absolute;
    top: 61.9%;
    left: 26.5%;
    width: 15.6%;
    height: 0.35%;
    background: #ffffff;
    border-radius: 2px;
    z-index: 3;
    animation: stripDipperFlasher 4.2s ease-in-out infinite;
}

/* High-Beam Forward Light Cone / Road Beams */
.truck-dipper-beam {
    position: absolute;
    top: 57%;
    left: 3%;
    width: 40%;
    height: 34%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(254, 240, 138, 0.6) 25%, rgba(250, 204, 21, 0.25) 60%, transparent 100%);
    clip-path: polygon(68% 14%, 96% 16%, 100% 100%, 0% 88%);
    pointer-events: none;
    z-index: 2;
    transform-origin: 82% 15%;
    animation: beamDipperFlasher 4.2s ease-in-out infinite;
}

/* Road Asphalt Surface Light Reflection */
.road-dipper-reflection {
    position: absolute;
    top: 67%;
    left: 10%;
    width: 32%;
    height: 18%;
    background: radial-gradient(ellipse at center, rgba(254, 240, 138, 0.45) 0%, rgba(250, 204, 21, 0.2) 45%, transparent 75%);
    filter: blur(14px);
    pointer-events: none;
    z-index: 2;
    animation: beamDipperFlasher 4.2s ease-in-out infinite;
}

/* Realistic Dipper Rhythm (High Beam double-flash cadence) */
@keyframes truckDipperFlasher {
    0%, 14% {
        /* Standard low beam / parking light */
        opacity: 0.35;
        transform: scale(0.95);
        box-shadow: 0 0 10px #ffffff, 0 0 20px #fde047;
    }
    18% {
        /* DIPPER FLASH 1 */
        opacity: 1;
        transform: scale(1.6);
        box-shadow: 0 0 20px #ffffff, 0 0 40px #fef08a, 0 0 65px #facc15;
    }
    23% {
        /* Brief dip */
        opacity: 0.2;
        transform: scale(0.85);
        box-shadow: 0 0 6px #ffffff;
    }
    28% {
        /* DIPPER FLASH 2 */
        opacity: 1;
        transform: scale(1.75);
        box-shadow: 0 0 25px #ffffff, 0 0 50px #fef08a, 0 0 80px #facc15;
    }
    36% {
        /* Return to normal low beam */
        opacity: 0.35;
        transform: scale(0.95);
        box-shadow: 0 0 10px #ffffff, 0 0 20px #fde047;
    }
    68% {
        opacity: 0.35;
        transform: scale(0.95);
        box-shadow: 0 0 10px #ffffff, 0 0 20px #fde047;
    }
    72% {
        /* Alert Dipper Flash (Single passing flash) */
        opacity: 1;
        transform: scale(1.65);
        box-shadow: 0 0 22px #ffffff, 0 0 45px #fef08a, 0 0 70px #facc15;
    }
    78% {
        opacity: 0.35;
        transform: scale(0.95);
        box-shadow: 0 0 10px #ffffff, 0 0 20px #fde047;
    }
    100% {
        opacity: 0.35;
        transform: scale(0.95);
        box-shadow: 0 0 10px #ffffff, 0 0 20px #fde047;
    }
}

@keyframes beamDipperFlasher {
    0%, 14% {
        opacity: 0.12;
        transform: scale(0.96);
    }
    18% {
        opacity: 0.95;
        transform: scale(1.08);
    }
    23% {
        opacity: 0.08;
        transform: scale(0.9);
    }
    28% {
        opacity: 1;
        transform: scale(1.12);
    }
    36% {
        opacity: 0.12;
        transform: scale(0.96);
    }
    68% {
        opacity: 0.12;
        transform: scale(0.96);
    }
    72% {
        opacity: 0.9;
        transform: scale(1.06);
    }
    78% {
        opacity: 0.12;
        transform: scale(0.96);
    }
    100% {
        opacity: 0.12;
        transform: scale(0.96);
    }
}

@keyframes stripDipperFlasher {
    0%, 14% {
        opacity: 0.45;
        box-shadow: 0 0 8px #ffffff, 0 0 16px #60a5fa;
    }
    18%, 28%, 72% {
        opacity: 1;
        box-shadow: 0 0 18px #ffffff, 0 0 32px #93c5fd, 0 0 50px #ffffff;
    }
    23% {
        opacity: 0.3;
        box-shadow: 0 0 5px #ffffff;
    }
    36%, 68%, 78%, 100% {
        opacity: 0.45;
        box-shadow: 0 0 8px #ffffff, 0 0 16px #60a5fa;
    }
}

/* Dynamic Radial Vignette Overlay: Crystal clear on the truck & dipper, smooth backing on card */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 35% 62%, rgba(15, 23, 42, 0.05) 0%, rgba(15, 23, 42, 0.35) 50%, rgba(10, 15, 29, 0.72) 100%);
    z-index: 1;
    pointer-events: none;
}

.login-card {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 2.8rem 2.4rem;
    border-radius: 20px;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.5);
    width: 100%;
    max-width: 430px;
    z-index: 2;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.6);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

/* ========================================================
   BILTY360 HIGHLIGHTED LOGO BADGE & AURA GLOW
   ======================================================== */
.logo-highlight-ring {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: auto;
    max-width: 290px;
    height: auto;
    border-radius: 18px;
    background: linear-gradient(135deg, #1e3a8a 0%, #dc2626 50%, #2563eb 100%);
    padding: 3px;
    margin-bottom: 0.9rem;
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.35), 0 0 18px rgba(220, 38, 38, 0.25);
    animation: logoPulseGlow 3.5s ease-in-out infinite;
    position: relative;
}

.login-logo {
    height: 60px;
    width: auto;
    max-width: 280px;
    border-radius: 15px;
    object-fit: contain;
    background: #ffffff;
    display: block;
    padding: 6px 18px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

@keyframes logoPulseGlow {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(37, 99, 235, 0.35), 0 0 18px rgba(217, 119, 6, 0.25);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 12px 35px rgba(37, 99, 235, 0.55), 0 0 28px rgba(217, 119, 6, 0.45);
        transform: scale(1.03);
    }
}

.login-title {
    font-size: 1.65rem;
    font-weight: 800;
    margin: 0;
    color: #1e3a8a; /* Royal Navy Blue */
    letter-spacing: -0.5px;
}

.login-title .title-accent {
    color: #b45309; /* Bronze Brown */
}

.login-subtitle {
    color: #475569;
    font-size: 0.9rem;
    margin-top: 0.4rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
    background-color: #f8fafc;
    color: #334155;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb; /* Sapphire blue focus matching theme */
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background-color: #fff;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #334155;
    font-weight: 600;
    font-size: 0.875rem;
}

.btn-login {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%); /* Royal Blue gradient */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    margin-top: 1rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

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

.login-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: #64748b;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    accent-color: #2563eb;
}

.form-check-label {
    color: #64748b;
    font-size: 0.875rem;
}

.extra-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.forgot-password {
    font-size: 0.875rem;
    color: #64748b;
    text-decoration: none;
}

.forgot-password:hover {
    color: #2563eb;
}

.login-error {
    background-color: rgba(254, 242, 242, 0.95);
    border: 1px solid rgba(254, 226, 226, 0.8);
    border-left: 4px solid #ea580c;
    color: #991b1b;
    padding: 0.875rem 2.5rem 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: shakeSlideIn 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.login-error.dismissing {
    animation: fadeOutDismiss 0.4s ease-in forwards;
}

.login-error .alert-icon {
    color: #ea580c;
    font-size: 1.1rem;
    flex-shrink: 0;
    animation: pulseIcon 2s infinite;
}

.login-error .alert-message {
    font-weight: 550;
    line-height: 1.4;
    flex-grow: 1;
}

.login-error .close-alert-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #991b1b;
    font-size: 1.35rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.login-error .close-alert-btn:hover {
    opacity: 1;
    background-color: rgba(254, 226, 226, 0.8);
    color: #ea580c;
}

.login-error .alert-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #ea580c 0%, #f97316 100%);
    width: 100%;
    animation: shrinkProgress 5s linear forwards;
}

@keyframes shakeSlideIn {
    0% {
        transform: translateY(-15px) scale(0.98);
        opacity: 0;
    }
    40% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% { transform: translateX(-6px); }
    60% { transform: translateX(5px); }
    70% { transform: translateX(-4px); }
    80% { transform: translateX(3px); }
    90% { transform: translateX(-1px); }
    100% { transform: translateX(0); }
}

@keyframes fadeOutDismiss {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes shrinkProgress {
    0% { width: 100%; }
    100% { width: 0%; }
}

@keyframes pulseIcon {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
