/* =========================================
   ESTILOS DEL MODAL DE AUTENTICACIÓN (DARK & MODERN)
   ========================================= */

.auth-modal {
    display: none;
    position: fixed;
    z-index: 3000 !important;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: rgba(5, 10, 20, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 20px 14px;
    box-sizing: border-box;
}

.auth-modal-content {
    background: linear-gradient(150deg, #131c2e 0%, #0c121e 100%);
    color: #e2e8f0;
    margin: 35px auto 45px auto;
    padding: 26px 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: 100%;
    max-width: 410px;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 35px rgba(37, 99, 235, 0.12);
    position: relative;
    box-sizing: border-box;
    animation: authModalSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Botón de cerrar circular flotante */
.auth-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.auth-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
    transform: rotate(90deg);
}

/* Encabezado del Formulario */
.auth-card-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.35);
    color: #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin: 0 auto 10px auto;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

.auth-icon-badge.register {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.auth-card-header h3 {
    margin: 0 0 4px 0;
    color: #ffffff;
    font-family: 'Space Grotesk', 'Montserrat', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
}

.auth-card-header p {
    margin: 0;
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Grupos de Inputs */
.auth-input-group {
    margin-bottom: 14px;
    text-align: left;
}

.auth-input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-field-icon {
    position: absolute;
    left: 13px;
    color: #64748b;
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.2s;
}

.auth-field-icon.textarea-icon {
    top: 13px;
}

.auth-modal input[type="text"],
.auth-modal input[type="email"],
.auth-modal input[type="password"],
.auth-modal input[type="tel"],
.auth-modal textarea {
    width: 100%;
    padding: 11px 14px 11px 38px;
    background: #0e1524;
    border: 1px solid #222f46;
    border-radius: 12px;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.92rem;
    outline: none;
    box-sizing: border-box;
    transition: all 0.22s ease;
}

.auth-modal textarea {
    resize: none;
    min-height: 55px;
    line-height: 1.4;
}

.auth-modal input:focus,
.auth-modal textarea:focus {
    border-color: #38bdf8;
    background: #141f33;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22);
}

.auth-input-wrapper:focus-within .auth-field-icon {
    color: #38bdf8;
}

/* Contenedor de contraseña */
.password-container {
    position: relative;
    width: 100%;
}

.password-container input {
    padding-right: 40px !important;
}

.toggle-password-icon {
    position: absolute;
    right: 13px;
    color: #64748b;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 4px;
    transition: color 0.2s;
    z-index: 3;
}

.toggle-password-icon:hover {
    color: #38bdf8;
}

/* Botón Submit */
.btn-auth-submit,
.auth-modal button[type="submit"] {
    width: 100%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 0.96rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
    box-shadow: 0 5px 16px rgba(37, 99, 235, 0.35);
    transition: all 0.22s ease;
    box-sizing: border-box;
}

.btn-auth-submit:hover,
.auth-modal button[type="submit"]:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    transform: translateY(-1.5px);
    box-shadow: 0 7px 20px rgba(37, 99, 235, 0.48);
}

.btn-auth-submit:active,
.auth-modal button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Separador */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 18px 0 14px 0;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    padding: 0 12px;
}

/* Wrapper del Botón de Google para Cero Desborde */
.google-btn-wrapper {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    overflow: hidden;
    margin: 4px auto 14px auto;
}

.google-btn-wrapper > div {
    max-width: 100% !important;
}

.google-btn-wrapper iframe {
    max-width: 100% !important;
}

/* Enlaces de alternancia */
.auth-switch {
    text-align: center;
    margin: 14px 0 0 0;
    font-size: 0.85rem;
    color: #94a3b8;
}

.auth-switch a {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.auth-switch a:hover {
    color: #7dd3fc;
    text-decoration: underline;
}