/* ============================================
   LOGIN PAGE STYLES
   ============================================ */

/* Main login container with gradient background */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #eef7f8 50%, #e7f1f3 100%);
}

/* Animated gradient orbs in background */
.login-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(41, 127, 191, 0.3), rgba(20, 105, 109, 0.2));
    top: -100px;
    left: -100px;
    animation: float 8s ease-in-out infinite;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(20, 105, 109, 0.25), rgba(41, 127, 191, 0.15));
    bottom: -50px;
    right: -50px;
    animation: float 10s ease-in-out infinite 1s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

/* Login content container */
.login-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 2rem;
}

/* Main login card */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 51, 54, 0.12),
                0 8px 24px rgba(0, 51, 54, 0.08);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Login header with logo */
.login-header {
    padding: 2rem 2rem 1.5rem;
    background: linear-gradient(135deg, rgba(41, 127, 191, 0.05), rgba(20, 105, 109, 0.03));
    border-bottom: 1px solid rgba(41, 127, 191, 0.1);
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.login-logo {
    width: 100%;
    max-width: 220px;
    height: auto;
    border-radius: .9rem;
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.9),
        0 0 0 6px rgba(41, 127, 191, 0.35),
        0 16px 40px rgba(41, 127, 191, 0.35);
    transition: transform .25s ease, box-shadow .25s ease;
}
.login-logo:hover {
    transform: translateY(-3px);
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.9),
        0 0 0 6px rgba(41, 127, 191, 0.5),
        0 20px 48px rgba(41, 127, 191, 0.45);
}

.logo-section .tagline {
    margin: 0;
    color: #404849;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Login form body */
.login-body {
    padding: 2rem;
}

.login-form-wrapper {
    width: 100%;
}

/* Form section header */
.form-section {
    margin-bottom: 1.8rem;
}

.form-section h2 {
    margin: 0 0 0.5rem 0;
    font-family: "Manrope", "Inter", sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #191c1d;
}

.form-description {
    margin: 0;
    color: #404849;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Alert/Error messages */
.alert {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 0.8rem;
    display: flex;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid;
    position: relative;
    transition: all 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.alert.shake {
    animation: shake 0.6s ease-in-out;
}

.alert-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(220, 38, 38, 0.05));
    border-left-color: #dc2626;
    color: #b91c1c;
}

.alert-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
}

.alert-content {
    flex: 1;
}

.alert strong {
    display: block;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #7f1d1d;
}

.alert p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.alert-close {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.4rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.alert-close:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
}

.alert-close:active {
    transform: scale(0.95);
}

/* Form fields */
.form-field {
    margin-bottom: 1.3rem;
}

.form-field label {
    display: block;
    font-weight: 700;
    font-size: 0.8rem;
    color: #191c1d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
}

/* Input wrapper with icon */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    font-size: 1.2rem;
    opacity: 0.6;
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    border: 1.5px solid #e7e8e9;
    border-radius: 0.8rem;
    background: var(--surface-lowest);
    font-family: inherit;
    font-size: 0.95rem;
    color: #191c1d;
    transition: all 0.3s ease;
}

.form-input::placeholder {
    color: #999999;
}

.form-input:hover {
    border-color: #d0d1d2;
    background: #ffffff;
}

.form-input:focus {
    outline: none;
    border-color: #297fbf;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(41, 127, 191, 0.1);
}

.form-input:disabled {
    background: #f0f1f2;
    border-color: #e0e1e2;
    color: #999999;
    cursor: not-allowed;
    opacity: 0.7;
}

.form-input:disabled::placeholder {
    color: #bbb;
}

/* Validation messages */
.validation-message {
    font-size: 0.8rem;
    color: #dc2626;
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    animation: slideIn 0.3s ease-out;
}

.validation-message::before {
    content: "⚠️";
    font-size: 0.9rem;
}

/* Login button */
.btn-login {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.95rem 1.5rem;
    border: none;
    border-radius: 0.8rem;
    background: linear-gradient(135deg, #297fbf, #1f5f8f);
    color: white;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(41, 127, 191, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(41, 127, 191, 0.4);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.85;
    cursor: not-allowed;
}

.btn-login.loading {
    background: linear-gradient(90deg, 
        #297fbf 0%, 
        #1f5f8f 25%, 
        #1d6fa6 50%,
        #1f5f8f 75%, 
        #297fbf 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    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); }
}

/* Form footer */
.form-footer {
    margin-top: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hint-text {
    margin: 0;
    font-size: 0.8rem;
    color: #666666;
    letter-spacing: 0.03em;
}

.credentials-hint {
    margin: 0;
    font-size: 0.8rem;
    color: #666666;
    padding: 0.75rem;
    background: rgba(41, 127, 191, 0.05);
    border-radius: 0.6rem;
    border: 1px solid rgba(41, 127, 191, 0.1);
}

.credentials-hint strong {
    color: #297fbf;
    font-weight: 700;
}

/* Login card footer */
.login-footer {
    padding: 1rem 2rem;
    background: #f8f9fa;
    border-top: 1px solid #e7e8e9;
    text-align: center;
}

.footer-text {
    margin: 0;
    font-size: 0.75rem;
    color: #999999;
    letter-spacing: 0.03em;
}

/* Responsive design */
@media (max-width: 480px) {
    .login-content {
        padding: 1rem;
    }

    .login-card {
        border-radius: 1.2rem;
    }

    .login-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .login-body {
        padding: 1.5rem;
    }

    .login-logo {
        max-width: 220px;
    }

    .form-section h2 {
        font-size: 1.25rem;
    }

    .login-footer {
        padding: 0.8rem 1.5rem;
    }

    .gradient-orb {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    .form-input {
        border-width: 2px;
    }

    .login-card {
        border-width: 2px;
        border-color: #191c1d;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .gradient-orb,
    .form-input,
    .btn-login,
    .alert {
        animation: none;
        transition: none;
    }

    .btn-login:hover:not(:disabled) {
        transform: none;
    }
}
