/* Estilos de Aplicación Premium (Classic Blue Edition) - ALIANZAGSM */

body {
    background: #f8fafc;
    min-height: 100vh;
    font-family: 'Outfit', sans-serif;
    margin: 0;
}

.auth-container-fluid {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

/* Tarjeta Limpia, Profesional con Sombra de Elevación */
.auth-card-premium {
    background: #ffffff;
    border: 1px solid rgba(37, 99, 235, 0.08);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.03), 0 1px 3px rgba(0, 0, 0, 0.01);
    width: 100%;
    max-width: 420px;
    padding: 40px 30px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Superposición de luz sutil e interactiva */
.auth-card-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(600px circle at var(--mouse-x, 0px) var(--mouse-y, 0px), rgba(37, 99, 235, 0.04), transparent 40%);
    z-index: 1;
    pointer-events: none;
}

.auth-card-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.06), 0 1px 5px rgba(0, 0, 0, 0.02);
}

/* Cabecera */
.auth-header-brand {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
    z-index: 10;
}

.auth-logo-sphere {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0.15) 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border: 1px solid rgba(37, 99, 235, 0.15);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.auth-logo-icon {
    font-size: 26px;
}

.auth-header-brand h2 {
    font-size: 26px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.auth-header-brand p {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

/* Pestañas Switch Estilo Cápsula Clara */
.auth-tab-capsule {
    display: flex;
    background: #f1f5f9;
    padding: 5px;
    border-radius: 14px;
    margin-bottom: 25px;
    gap: 4px;
    border: 1px solid #e2e8f0;
    position: relative;
    z-index: 10;
}

.auth-tab-capsule .tab-btn {
    flex: 1;
    background: none;
    border: none;
    border-radius: 10px;
    color: #64748b;
    padding: 11px 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    outline: none;
}

.auth-tab-capsule .tab-btn.active {
    background: #ffffff;
    color: var(--primary) !important; /* Royal Blue */
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.05);
}

/* Viewport Deslizable */
.auth-slider-viewport {
    width: 100%;
    overflow: hidden;
    position: relative;
    z-index: 10;
}

.auth-slider-track {
    display: flex;
    width: 200%;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-slide-pane {
    width: 50%;
    flex-shrink: 0;
    padding: 2px;
    box-sizing: border-box;
}

/* Form Groups e Inputs */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Contenedor de Inputs Integrados (Estilo Nativo con Relleno Azul Suave) */
.input-with-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #ebf3fe; /* Relleno azul suave de la imagen */
    transition: all 0.2s ease;
    box-sizing: border-box;
    overflow: hidden;
    height: 48px;
}

.input-with-icon-wrapper:focus-within {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* Iconos de Prefijo y Separadores */
.input-prefix-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px 0 14px;
    font-size: 16px;
    color: #94a3b8;
    border-right: 1.5px solid #e2e8f0;
    height: 100%;
    user-select: none;
    background: rgba(37, 99, 235, 0.03);
    flex-shrink: 0;
}

.country-prefix-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px 0 14px;
    font-size: 13.5px;
    color: #334155;
    font-weight: 700;
    border-right: 1.5px solid #e2e8f0;
    height: 100%;
    user-select: none;
    background: rgba(37, 99, 235, 0.05);
    flex-shrink: 0;
}

/* Input propiamente dicho */
.input-premium-native {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 0 14px !important;
    font-size: 14.5px;
    color: #1e293b;
    outline: none !important;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    box-shadow: none !important;
}

.input-premium-native::placeholder {
    color: #94a3b8;
}

/* Estados de Validación con Borde en el Contenedor */
.input-with-icon-wrapper.is-valid {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12) !important;
}

.input-with-icon-wrapper.is-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12) !important;
}

/* Password Toggle */
.password-toggle-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    height: 100%;
}

.password-toggle-wrapper .input-premium-native {
    padding-right: 40px !important;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #94a3b8;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    z-index: 10;
}

/* Enlaces */
.forgot-password-link-wrapper {
    text-align: right;
    margin-top: 8px;
}

.forgot-password-link {
    font-size: 12.5px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.forgot-password-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Botones de Envío */
.btn-submit-premium {
    width: 100%;
    padding: 13px 20px;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    transition: all 0.2s ease;
    margin-top: 15px;
    outline: none;
}

.btn-submit-premium:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.btn-submit-premium:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-arrow {
    font-weight: bold;
    transition: transform 0.2s ease;
}

.btn-submit-premium:hover .btn-arrow {
    transform: translateX(4px);
}

/* OTP */
.btn-submit--otp {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-submit--otp:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.otp-success-alert {
    background: rgba(16, 185, 129, 0.05);
    border: 1.5px solid rgba(16, 185, 129, 0.2);
    color: #065f46;
    border-radius: 12px;
    padding: 12px 15px;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.otp-code-input {
    letter-spacing: 8px;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
}

.otp-back-wrapper {
    text-align: center;
    margin-top: 15px;
}

.otp-back-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 13px;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s;
}

.otp-back-btn:hover {
    color: #475569;
}

/* Demo Modal */
.demo-otp-modal {
    display: none;
    margin-top: 20px;
    padding: 15px;
    border-radius: 12px;
    background: rgba(14, 165, 233, 0.05);
    border: 1.5px solid rgba(14, 165, 233, 0.15);
    color: #0369a1;
    text-align: center;
}

.demo-otp-title {
    margin: 0 0 5px 0;
    color: #0284c7;
    font-size: 13px;
    font-weight: 800;
}

.demo-otp-desc {
    margin: 0;
    font-size: 12px;
    color: #0284c7;
}

.demo-code-text {
    color: #0284c7;
    font-size: 16px;
    font-weight: 800;
}

/* Alerts */
.alert {
    padding: 12px 15px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 10;
}

.alert-error {
    background: rgba(239, 68, 68, 0.05);
    border: 1.5px solid rgba(239, 68, 68, 0.2);
    color: #991b1b;
}

.alert-success {
    background: rgba(16, 185, 129, 0.05);
    border: 1.5px solid rgba(16, 185, 129, 0.2);
    color: #065f46;
}

/* Footer */
.auth-card-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    position: relative;
    z-index: 10;
}

.form-footer-text {
    font-size: 13.5px;
    color: #64748b;
    margin: 0;
}

.footer-register-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-register-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Alerta de bloqueo de mayúsculas */
.caps-warning-hidden {
    display: none;
    color: #ef4444;
    font-size: 12px;
    margin-top: 6px;
    font-weight: 600;
    text-align: left;
}

/* Sugerencias de dominio de correo electrónico */
.email-suggestions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    transition: all 0.3s ease;
}

.email-suggest-pill {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.email-suggest-pill:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* Switch de Mantener Sesión Iniciada */
.remember-me-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    user-select: none;
}

.switch-container {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.switch-container input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 24px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.switch-container input:checked + .switch-slider {
    background-color: var(--primary); /* Cambiado a azul */
}

.switch-container input:checked + .switch-slider:before {
    transform: translateX(18px);
}

.switch-label {
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
}

/* Spinner de Carga de Envío */
.btn-spinner {
    display: inline-block;
    animation: rotateSpinner 1s linear infinite;
    font-size: 14px;
}

@keyframes rotateSpinner {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- AJUSTE DE APLICACIÓN 100% NATIVA EN MÓVILES --- */
@media (max-width: 480px) {
    body {
        background: #ffffff;
    }

    .auth-container-fluid {
        padding: 0;
        align-items: flex-start;
    }

    .auth-card-premium {
        border: none;
        box-shadow: none;
        border-radius: 0;
        padding: 30px 20px;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .auth-slider-viewport {
        flex: 1;
        margin-bottom: 20px;
    }

    .auth-tab-capsule {
        margin-bottom: 25px;
    }

    .auth-card-footer {
        border-top: 1px solid #f1f5f9;
        padding-top: 20px;
        margin-top: auto;
    }
}
