/**
 * Login Page - Professional Dark Theme
 * Optimized for eye comfort and modern aesthetics
 */

* {
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden !important;
    background: linear-gradient(135deg, #0f1115 0%, #1a1d23 50%, #22252d 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Wave Background === */
.wave {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 100%;
    z-index: -1;
    opacity: 0.15;
    filter: hue-rotate(180deg) brightness(0.4);
}

/* === Container === */
.container-login {
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 7rem;
    padding: 0 2rem;
    background: transparent;
    position: relative;
}

/* Animated gradient overlay */
.container-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(74, 158, 255, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(124, 58, 237, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* === Image Section === */
.img {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.img img {
    width: 500px;
    filter: drop-shadow(0 10px 40px rgba(74, 158, 255, 0.3));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* === Login Content === */
.login-content {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* === Login Form === */
form {
    width: 400px;
    background: rgba(34, 37, 45, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem 2.5rem !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: slideUp 0.6s ease;
}

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

/* === Logo === */
.login-content img {
    height: 80px;
    margin-bottom: 1.5rem !important;
    filter: drop-shadow(0 4px 12px rgba(74, 158, 255, 0.3));
}

/* === Title === */
.login-content h2 {
    margin: 1rem 0 2rem 0 !important;
    color: #e4e6eb;
    text-transform: uppercase;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, #e4e6eb 0%, #b8bcc8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === Input Divs === */
.login-content .input-div {
    position: relative;
    display: grid;
    grid-template-columns: 10% 90%;
    margin: 1.5rem 0 !important;
    padding: 0 !important;
    background: rgba(42, 45, 53, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    overflow: hidden;
}

.login-content .input-div.one {
    margin-top: 0 !important;
}

.login-content .input-div:hover {
    background: rgba(47, 50, 58, 0.8);
    border-color: rgba(74, 158, 255, 0.2);
}

/* === Icon === */
.i {
    color: #8b92a4;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 0.75rem !important;
    transition: color 0.3s ease;
}

.i i {
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

/* === Input Container === */
.input-div > div {
    position: relative;
    height: 56px;
    padding: 0 !important;
}

/* === Label === */
.input-div > div > h5 {
    position: absolute;
    left: 1rem !important;
    top: 50%;
    transform: translateY(-50%);
    color: #8b92a4;
    font-size: 0.95rem;
    font-weight: 400;
    transition: all 0.3s ease;
    pointer-events: none;
    background: transparent;
    padding: 0 0.25rem !important;
}

/* === Focus State === */
.input-div.focus {
    background: rgba(47, 50, 58, 0.9);
    border-color: #4a9eff;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15),
                0 4px 12px rgba(0, 0, 0, 0.3);
}

.input-div.focus > div > h5 {
    top: -10px !important;
    left: 1rem !important;
    font-size: 0.75rem;
    color: #4a9eff;
    background: #22252d;
    padding: 0 0.5rem !important;
    border-radius: 4px;
}

.input-div.focus > .i > i {
    color: #4a9eff;
    transform: scale(1.1);
}

/* === Input Field === */
.input-div > div > input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    padding: 0 1rem !important;
    font-size: 1rem;
    color: #e4e6eb;
    font-family: 'Inter', 'Poppins', sans-serif;
    font-weight: 400;
}

.input-div > div > input::placeholder {
    color: #5a5f6f;
}

.input-div > div > input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #2a2d35 inset !important;
    -webkit-text-fill-color: #e4e6eb !important;
}

/* === Password Field === */
.input-div.pass {
    margin-bottom: 1rem !important;
}

/* === Links === */
a {
    display: block;
    text-align: right;
    text-decoration: none;
    color: #8b92a4;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    padding: 0.5rem 0 !important;
}

a:hover {
    color: #4a9eff;
    transform: translateX(-2px);
}

/* === Submit Button === */
.btn {
    display: block;
    width: 100%;
    height: 54px;
    border-radius: 12px;
    outline: none;
    border: none;
    background: linear-gradient(135deg, #4a9eff 0%, #7c3aed 100%);
    background-size: 200% 100%;
    font-size: 1rem;
    font-family: 'Inter', 'Poppins', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 2rem 0 1rem 0 !important;
    cursor: pointer;
    transition: all 0.4s ease;
    color: white;
    box-shadow: 0 8px 24px rgba(74, 158, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover {
    background-position: right;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(74, 158, 255, 0.4),
                0 0 0 3px rgba(74, 158, 255, 0.2);
}

.btn:hover::before {
    left: 100%;
}

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

/* === Alert Messages === */
.alert {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-left: 4px solid #ef4444;
    color: #ef4444;
    padding: 1rem !important;
    border-radius: 8px;
    margin-bottom: 1.5rem !important;
    font-size: 0.875rem;
}

.alert.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    border-left-color: #10b981;
    color: #10b981;
}

/* === Footer Text === */
.login-footer {
    text-align: center;
    color: #5a5f6f;
    font-size: 0.8rem;
    margin-top: 2rem !important;
}

.login-footer a {
    color: #4a9eff;
    text-align: center;
}

/* === Loading State === */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === Responsive Design === */
@media screen and (max-width: 1050px) {
    .container-login {
        grid-gap: 5rem;
    }

    form {
        width: 380px;
    }
}

@media screen and (max-width: 1000px) {
    form {
        width: 340px;
        padding: 2.5rem 2rem !important;
    }

    .login-content h2 {
        font-size: 1.75rem;
        margin: 0.75rem 0 1.5rem 0 !important;
    }

    .img img {
        width: 400px;
    }
}

@media screen and (max-width: 900px) {
    .container-login {
        grid-template-columns: 1fr;
        padding: 2rem;
    }

    .img {
        display: none;
    }

    .wave {
        display: none;
    }

    .login-content {
        justify-content: center;
    }

    form {
        width: 100%;
        max-width: 420px;
    }
}

@media screen and (max-width: 600px) {
    .container-login {
        padding: 1rem;
    }

    form {
        padding: 2rem 1.5rem !important;
        border-radius: 20px;
    }

    .login-content h2 {
        font-size: 1.5rem;
    }

    .input-div > div {
        height: 52px;
    }

    .btn {
        height: 50px;
        font-size: 0.9375rem;
    }
}

/* === Accessibility === */
.input-div > div > input:focus {
    outline: none;
}

.btn:focus-visible {
    outline: 2px solid #4a9eff;
    outline-offset: 2px;
}

a:focus-visible {
    outline: 2px solid #4a9eff;
    outline-offset: 2px;
    border-radius: 4px;
}

/* === Dark Mode Enhancements === */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark mode */
}

/* === Print === */
@media print {
    .wave,
    .img {
        display: none;
    }

    form {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
