/* ============================================
   LOGIN MODERNO - CAMPO ROMERO
   ============================================ */

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

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

body {
    background: linear-gradient(135deg, #5A3E2B 0%, #6B4F3C 20%, #587A6E 50%, #6B8E7A 75%, #5A3E2B 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Background animated circles */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(90, 62, 43, 0.15);
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.circle-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    right: -50px;
    animation-delay: 5s;
}

.circle-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    right: 10%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    33% {
        transform: translate(50px, -50px) scale(1.1);
        opacity: 0.5;
    }
    66% {
        transform: translate(-30px, 30px) scale(0.9);
        opacity: 0.4;
    }
}

/* Login Container */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #5A3E2B, #6B4F3C, #587A6E, #6B8E7A, #5A3E2B);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo-img {
    max-width: 280px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    margin-bottom: 35px;
}

.welcome-title {
    font-size: 32px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.welcome-subtitle {
    font-size: 16px;
    color: #718096;
    font-weight: 400;
}

/* Alert Message */
.alert-message {
    background: #fee;
    border-left: 4px solid #f56565;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

.alert-message i {
    font-size: 18px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input Groups */
.input-group-modern {
    position: relative;
    margin-bottom: 20px;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 18px;
    z-index: 2;
    pointer-events: none;
    transition: color 0.3s ease;
}

.form-control-modern {
    width: 100%;
    padding: 16px 16px 16px 50px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #2d3748;
    transition: all 0.3s ease;
    outline: none;
}

.form-control-modern:focus {
    border-color: #587A6E;
    box-shadow: 0 0 0 3px rgba(88, 122, 110, 0.1);
}

.form-control-modern:focus + .input-icon,
.input-group-modern:focus-within .input-icon {
    color: #587A6E;
}

.form-control-modern::placeholder {
    color: #a0aec0;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #a0aec0;
    font-size: 18px;
    z-index: 2;
    transition: color 0.3s ease;
    padding: 5px;
}

.password-toggle:hover {
    color: #587A6E;
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #5A3E2B 0%, #6B4F3C 50%, #587A6E 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(90, 62, 43, 0.4);
}

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

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

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(90, 62, 43, 0.5);
    background: linear-gradient(135deg, #6B4F3C 0%, #7A5F4D 50%, #6B8E7A 100%);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(90, 62, 43, 0.4);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-text {
    display: inline-block;
    position: relative;
    z-index: 1;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Login Footer */
.login-footer {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.login-footer p {
    color: #a0aec0;
    font-size: 14px;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 480px) {
    .login-box {
        padding: 40px 30px;
        border-radius: 20px;
    }

    .welcome-title {
        font-size: 28px;
    }

    .welcome-subtitle {
        font-size: 14px;
    }

    .form-control-modern {
        padding: 14px 14px 14px 45px;
        font-size: 15px;
    }

    .btn-login {
        padding: 14px;
        font-size: 16px;
    }

    .logo-img {
        max-width: 220px;
    }
}

/* Animation classes */
.animated {
    animation-duration: 0.6s;
    animation-fill-mode: both;
}

.fadeInDown {
    animation-name: fadeInDown;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -30px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Focus visible for accessibility */
.form-control-modern:focus-visible,
.btn-login:focus-visible {
    outline: 3px solid rgba(88, 122, 110, 0.5);
    outline-offset: 2px;
}
