body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
    /* Allow vertical scroll if needed */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 3D Background Canvas */
#three-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

/* Login Container - Better Centering */
.login-container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    /* Balanced padding */
    box-sizing: border-box;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 35px;
    width: 100%;
    max-width: 400px;
    /* Smaller for better proportions */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.8s ease-out;
    margin: auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-section {
    text-align: center;
    margin-bottom: 25px;
}

.logo-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.logo-icon i {
    font-size: 35px;
    color: white;
}

.brand-title {
    font-size: 26px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 5px;
}

.brand-subtitle {
    color: #718096;
    font-size: 14px;
    margin-bottom: 0;
}

.form-floating {
    margin-bottom: 18px;
}

.form-floating input {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 15px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-floating input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-floating label {
    color: #718096;
    font-weight: 500;
    font-size: 14px;
}

.login-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    width: 100%;
    transition: all 0.3s ease;
    margin-bottom: 18px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.features-list {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 12px;
    padding: 18px;
    margin-top: 15px;
}

.features-list h6 {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: #4a5568;
    font-size: 13px;
}

.feature-item:last-child {
    margin-bottom: 0;
}

.feature-item i {
    color: #667eea;
    margin-right: 10px;
    font-size: 14px;
    width: 16px;
}

.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.floating-icon {
    position: absolute;
    color: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.floating-icon:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-icon:nth-child(2) {
    top: 20%;
    right: 15%;
    animation-delay: 1s;
}

.floating-icon:nth-child(3) {
    bottom: 30%;
    left: 20%;
    animation-delay: 2s;
}

.floating-icon:nth-child(4) {
    bottom: 20%;
    right: 25%;
    animation-delay: 3s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Loading animation */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        padding: 20px 15px;
    }

    .login-card {
        padding: 25px 20px;
        max-width: 100%;
        margin: 10px auto;
    }

    .brand-title {
        font-size: 22px;
    }

    .floating-icon {
        display: none;
        /* Hide floating icons on mobile */
    }
}

@media (max-height: 700px) {
    .login-container {
        padding: 20px;
    }

    .login-card {
        padding: 25px;
    }

    .logo-section {
        margin-bottom: 20px;
    }

    .features-list {
        margin-top: 10px;
        padding: 15px;
    }
}

@media (min-height: 900px) {
    .login-container {
        padding: 60px 20px;
        /* More padding on very tall screens */
    }
}

/* Smooth focus states */
.form-control:focus {
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1) !important;
}

.form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}


/* Password Toggle Styling */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    z-index: 10;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #495057;
}

.password-toggle:focus {
    outline: none;
    color: #667eea;
}

/* Adjust padding for password input to make room for toggle */
.form-floating input#password {
    padding-right: 45px;
}