/* Variables de color - mantener consistencia con el diseño actual */
:root {
    --primary-color: #0A5C36;
    --primary-hover: #0d7444;
    --error-color: #dc3545;
    --success-color: #28a745;
    --background-color: #f8f9fa;
    --text-color: #333;
    --border-color: #ddd;
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    margin: 20px auto;
    animation: fadeIn 0.5s ease-out;
}

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

.login-header img {
    width: 120px;
    height: auto;
    margin-bottom: 1rem;
}

.login-header h2 {
    color: var(--primary-color);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #666;
    font-size: 0.9rem;
}

/* Mensajes de estado */
.mensaje-exito, .mensaje-error, .mensaje-warning {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.mensaje-exito {
    background-color: rgba(40, 167, 69, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.mensaje-error {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

.mensaje-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    color: #856404;
}

.mensaje-exito i, .mensaje-error i, .mensaje-warning i {
    font-size: 1.2rem;
}

.error-message {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

input.error {
    border-color: #dc3545 !important;
}

input.error:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-group label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(10, 92, 54, 0.1);
    outline: none;
}

.password-container {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary-color);
}

.remember-container {
    display: flex;
    align-items: center;
    margin: 1rem 0;
}

.remember-container input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.remember-container label {
    font-size: 0.9rem;
    color: #666;
    cursor: pointer;
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.btn-login:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(10, 92, 54, 0.2);
}

.register-link {
    text-align: center;
    margin-top: 1.5rem;
}

.register-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.register-link a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.recover-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-color);
}

.recover-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.recover-link a:hover {
    color: var(--primary-color-dark);
    text-decoration: underline;
}

/* CAPTCHA */
.captcha-container,
.captcha-box,
.captcha-question {
    display: none;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* MODAL DE EXITO */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 80%;
    max-width: 400px;
    text-align: center;
    position: relative;
}

.modal-content i {
    font-size: 48px;
    color: #28a745;
    margin-bottom: 15px;
}

.close-modal {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.close-modal:hover {
    color: #333;
}


/* Media queries */
@media (max-width: 576px) {
    .login-container {
        padding: 1.5rem;
        margin: 10px;
    }

    .login-header img {
        width: 100px;
    }

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

    .form-group input {
        font-size: 16px; /* Previene zoom en iOS */
    }

    .btn-login {
        padding: 0.875rem;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .login-container {
        max-width: 380px;
    }
}

@media (min-width: 769px) {
    .login-container:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    }
}