/* ===== Páginas de Autenticación (Login/Register) ===== */

* {
    box-sizing: border-box;
}

/* Estilos globales para iconos Lucide */
[data-lucide] {
    width: 18px;
    height: 18px;
    stroke-width: 1px;
}

body.auth-page {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto; /* Permite scroll vertical si el contenido es muy alto */
}

/* Fondo con imagen y overlay */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-image: url('../images/fondoLogin.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.auth-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.15);
    z-index: 1;
}

/* Header específico para auth - ANULA el fixed de header-public.css */
body.auth-page .auth-header {
    position: relative !important;
    top: auto !important;
    background: #ffffff;
    padding: 3px 18px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-header .nav {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-header .logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-header .logo img {
    height: 55px;
    width: auto;
    display: block;
}

.auth-header .logo a {
    text-decoration: none;
    color: #0f9d58;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-header .menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 24px;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.auth-header .menu li a {
    text-decoration: none;
    color: #333;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 16px;
    display: block;
}

.auth-header .menu-icons {
    display: flex;
    gap: 24px;
    align-items: center;
    white-space: nowrap;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 10px;
}

.auth-header .menu-icons a {
    text-decoration: none;
    color: #333;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.auth-header .menu-icons a i,
.auth-header .menu-icons a img {
    width: 18px;
    height: 18px;
    stroke-width: 1px;
}

.auth-header .menu-icons .header-btn-account {
    padding: 8px 16px;
    border-radius: 8px;
    background: transparent;
    color: #333;
    transition: all 0.2s ease;
    border: none;
}

.auth-header .menu-icons .header-btn-account:hover {
    background: #25794F;
    color: #ffffff;
}

.auth-header .menu-icons .header-btn-account.logged-in {
    background: #25794F;
    color: #ffffff;
}

.auth-header .menu-icons .header-btn-account.logged-in:hover {
    background: #1f6a3f;
}

/* Contenedor principal del formulario */
.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    min-height: 0; /* Permite shrink si el contenido es muy alto */
    overflow-y: auto; /* Permite scroll si la tarjeta es muy alta */
}

.auth-card {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    padding: 48px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Layout de dos columnas para registro */
.register-card {
    max-width: 1000px;
}

.register-two-columns {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    align-items: flex-start;
    margin-top: 32px;
}

.register-social-column,
.register-form-column {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.register-social-column {
    justify-content: center;
    align-items: center;
}

.register-social-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
    text-align: center;
}

.register-social-column .auth-switch {
    margin-top: 24px;
    width: 100%;
}

.register-column-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #1a1a1a;
    text-align: center;
}

.register-social-column .register-column-title {
    text-align: center;
}

.register-form-column .register-column-title {
    text-align: center;
}

.register-column-subtitle {
    font-family: 'Open Sans', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #6E6E73;
    margin: 0 0 24px 0;
    line-height: 1.5;
    text-align: center;
}

.register-social-column .register-column-subtitle {
    text-align: center;
}

.register-form-column .register-column-subtitle {
    text-align: left;
}

.register-divider-vertical {
    width: 1px;
    background: #e0e0e0;
    align-self: stretch;
    min-height: 400px;
}

.register-social-column .auth-social-buttons {
    margin-bottom: 0;
    width: 100%;
}

.register-social-column .auth-social-btn {
    width: 100%;
}

.register-form-column .auth-form {
    margin-top: 0;
}

.auth-card-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #000000;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    transition: opacity 0.2s;
}

.auth-card-close:hover {
    opacity: 0.7;
}

.auth-card h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1a1a1a;
    text-align: center;
}

.auth-card .auth-subtitle {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #6E6E73;
    margin: 0 0 8px 0;
    line-height: 1.5;
    text-align: center;
}

/* Mensajes de error/éxito */
.auth-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
}

.auth-message i,
.auth-message svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.auth-message-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.auth-message-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.auth-field-error {
    display: block;
    font-family: 'Open Sans', sans-serif;
    font-size: 12px;
    color: #d32f2f;
    margin-top: 4px;
    padding-left: 4px;
}

/* Botones de login social */
.auth-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
}

.auth-social-btn:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

.auth-social-btn img {
    width: 20px;
    height: 20px;
}

/* Red de seguridad: Ocultar cualquier botón de Google que aparezca fuera de .auth-card */
body.auth-page header .g_id_signin,
body.auth-page header [id^="g_id_"],
body.auth-page header [class*="g_id_"],
body.auth-page .auth-header .g_id_signin,
body.auth-page .auth-header [id^="g_id_"],
body.auth-page .auth-header [class*="g_id_"],
body.auth-page:not(.auth-card) .g_id_signin {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

/* Asegurar que el contenedor de Google dentro de .auth-card esté oculto pero funcional */
.auth-card #googleBtnLogin,
.auth-card #googleBtnRegister {
    display: none !important;
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* Separador */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    font-family: 'Open Sans', sans-serif;
    color: #999;
    font-size: 14px;
    font-weight: 400;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.auth-divider span {
    padding: 0 16px;
}

/* Formulario */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-form-group label {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.auth-form-group label .required {
    color: #d32f2f;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrapper .input-icon {
    position: absolute;
    left: 12px;
    color: #999;
    font-size: 18px;
    pointer-events: none;
    z-index: 1;
    display: flex;
    align-items: center;
    width: 18px;
    height: 18px;
}

.auth-input-wrapper .input-icon i,
.auth-input-wrapper .input-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 1px;
}

.auth-input-wrapper input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid #D1D1D6;
    border-radius: 8px;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 300;
    background: #F3F3F5;
    color: #000000;
    transition: all 0.2s;
}

.auth-input-wrapper input::placeholder {
    color: #99A1AF;
}

.auth-input-wrapper input:hover {
    border-color: rgba(31,122,74,0.35);
    box-shadow: 0 2px 8px rgba(31,122,74,0.1);
}

.auth-input-wrapper input:focus {
    outline: none;
    border-color: rgba(31,122,74,0.45);
    background: #F3F3F5;
    color: #000000;
    box-shadow: 0 2px 8px rgba(31,122,74,0.15);
}

.auth-input-wrapper input.valid {
    border-color: #25794F;
}

.auth-input-wrapper input.invalid {
    border-color: #d32f2f;
}

.password-requirements {
    font-size: 12px;
    font-family: 'Open Sans', sans-serif;
    margin-top: 4px;
    padding-left: 4px;
}

.password-requirements.valid {
    color: #25794F;
}

.password-requirements.invalid {
    color: #d32f2f;
}

.password-requirements ul {
    margin: 4px 0 0 0;
    padding-left: 20px;
    list-style: none;
}

.password-requirements li {
    margin: 2px 0;
    position: relative;
}

.password-requirements li::before {
    content: '•';
    position: absolute;
    left: -12px;
}

.password-requirements li.valid::before {
    content: '✓';
    color: #25794F;
}

.password-requirements li.invalid::before {
    content: '✗';
    color: #d32f2f;
}

.password-match-message {
    font-size: 12px;
    font-family: 'Open Sans', sans-serif;
    margin-top: 4px;
    padding-left: 4px;
}

.password-match-message.valid {
    color: #25794F;
}

.password-match-message.invalid {
    color: #d32f2f;
}

.auth-input-wrapper .password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    display: flex;
    align-items: center;
    z-index: 2;
    width: 24px;
    height: 24px;
    justify-content: center;
    transition: opacity 0.2s;
}

.auth-input-wrapper .password-toggle:hover {
    opacity: 0.7;
}

.auth-input-wrapper .password-toggle i,
.auth-input-wrapper .password-toggle svg {
    width: 18px;
    height: 18px;
    stroke-width: 1px;
}

/* Opciones adicionales */
.auth-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
}

.auth-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-checkbox-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #25794F;
}

.auth-checkbox-wrapper label {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    color: #6E6E73;
    cursor: pointer;
    transition: color 0.2s;
}

.auth-checkbox-wrapper input[type="checkbox"]:checked ~ label,
.auth-checkbox-wrapper input[type="checkbox"]:checked + label {
    color: #000000;
}

.auth-link {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    color: #0f9d58;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Botones de acción */
.auth-form-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.auth-btn-primary {
    padding: 14px 24px;
    background: #D1D5DC;
    color: #25794F;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: not-allowed;
    opacity: 0.5;
    transition: all 0.2s;
    pointer-events: none;
    width: 100%;
}

.auth-btn-primary:enabled,
.auth-btn-primary.enabled {
    background: #25794F;
    color: #FFFFFF;
    cursor: pointer;
    opacity: 1;
    pointer-events: auto;
}

.auth-btn-primary:enabled:hover,
.auth-btn-primary.enabled:hover {
    background: #1f6a3f;
}

.auth-btn-secondary {
    padding: 14px 24px;
    background: #ffffff;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    display: block;
    width: 100%;
}

.auth-btn-secondary:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

/* Enlace de registro/login */
.auth-switch {
    text-align: center;
    margin-top: 24px;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #666;
}

.auth-switch a {
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    color: #0f9d58;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Footer */
.auth-footer {
    position: relative;
    z-index: 10;
    background: #2a2a2a;
    color: #ffffff;
    padding: 9.6px 0;
}

.auth-footer-content {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 19px;
}

.auth-footer-links {
    display: flex;
    gap: 26px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.auth-footer-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s;
}

.auth-footer-links a:hover {
    color: #0f9d58;
}

.auth-footer-copyright {
    font-size: 12px;
    color: #999;
}

.auth-footer-social {
    display: flex;
    gap: 19px;
}

.auth-footer-social a {
    color: #ffffff;
    font-size: 16.5px;
    text-decoration: none;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-footer-social a i {
    color: #ffffff;
}

.auth-footer-social a:hover {
    opacity: 0.8;
}

/* Página de Recuperación de Contraseña */
.recovery-step {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
    .register-two-columns {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .register-divider-vertical {
        display: none;
    }

    .register-social-column,
    .register-form-column {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .auth-card {
        padding: 32px 24px;
    }

    .register-card {
        max-width: 100%;
    }

    .register-two-columns {
        gap: 24px;
        margin-top: 24px;
    }

    .register-column-title {
        font-size: 18px;
    }

    .register-column-subtitle {
        font-size: 12px;
        margin-bottom: 20px;
    }
    
    .auth-header .menu {
        display: none;
    }
    
    .auth-footer-content {
        flex-direction: column;
        text-align: center;
    }

    .recovery-modal-content {
        padding: 24px;
        width: 95%;
    }
}

