/* ==========================================================================
   CLUB SABORATOR — SISTEMA DE AUTENTICACIÓN ESTILO KFC FAST-FOOD
   Optimizado para Alta Conversión, Acceso por WhatsApp OTP y Google OAuth Oficial
   ========================================================================== */

/* ── OVERLAY Y CONTENEDOR PRINCIPAL ── */
.modal-ingreso-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 5, 8, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-ingreso-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-ingreso-box {
    background: #FFFFFF;
    color: #1A1A1A;
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    padding: 1.5rem 1.5rem 1.35rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.06);
    position: relative;
    transform: scale(0.96) translateY(10px);
    transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 94vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-ingreso-overlay.active .modal-ingreso-box {
    transform: scale(1) translateY(0);
}

/* Modo Oscuro para Club Saborator */
:root[data-theme="dark"] .modal-ingreso-box,
[data-theme="dark"] .modal-ingreso-box {
    background: #18090D;
    color: #FFFFFF;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(244, 168, 23, 0.3);
}

/* Botón de Cierre */
.modal-ingreso-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #F3F4F6;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    line-height: 1;
    color: #6B7280;
    cursor: pointer;
    transition: all 160ms ease;
    z-index: 2;
}

:root[data-theme="dark"] .modal-ingreso-close,
[data-theme="dark"] .modal-ingreso-close {
    background: rgba(255, 255, 255, 0.1);
    color: #E8DFD0;
}

.modal-ingreso-close:hover {
    background: #FEE2E2;
    color: #DC2626;
    transform: rotate(90deg);
}

/* ── CABECERA DESTACADA CLUB SABORATOR (ESTILO KFC) ── */
.kfc-auth-header {
    text-align: center;
    margin-bottom: 1.4rem;
}

.kfc-club-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: #FEE2E2;
    color: #6B4226;
    border: 1px solid rgba(107, 66, 38, 0.25);
    margin-bottom: 0.5rem;
}

:root[data-theme="dark"] .kfc-club-badge,
[data-theme="dark"] .kfc-club-badge {
    background: rgba(107, 66, 38, 0.18);
    color: #FF5A70;
    border-color: rgba(107, 66, 38, 0.4);
}

.kfc-auth-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #111827;
    margin: 0.2rem 0 0.35rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

:root[data-theme="dark"] .kfc-auth-title,
[data-theme="dark"] .kfc-auth-title {
    color: #FFFFFF;
}

.kfc-auth-sub {
    font-size: 0.86rem;
    color: #4B5563;
    line-height: 1.45;
    margin: 0;
}

:root[data-theme="dark"] .kfc-auth-sub,
[data-theme="dark"] .kfc-auth-sub {
    color: #9CA3AF;
}

/* ── PESTAÑAS DE ACCESO RÁPIDO ESTILO FAST-FOOD ── */
.kfc-tab-selector {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    background: #F3F4F6;
    padding: 3px;
    border-radius: 12px;
    margin-bottom: 1.35rem;
    gap: 3px;
}

:root[data-theme="dark"] .kfc-tab-selector,
[data-theme="dark"] .kfc-tab-selector {
    background: rgba(255, 255, 255, 0.08);
}

.kfc-tab-btn {
    border: none;
    background: transparent;
    padding: 0.65rem 0.5rem;
    border-radius: 9px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #4B5563;
    cursor: pointer;
    transition: all 160ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
}

:root[data-theme="dark"] .kfc-tab-btn,
[data-theme="dark"] .kfc-tab-btn {
    color: #D1D5DB;
}

.kfc-tab-btn.active {
    background: #FFFFFF;
    color: #6B4226;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

:root[data-theme="dark"] .kfc-tab-btn.active,
[data-theme="dark"] .kfc-tab-btn.active {
    background: #2A1C16;
    color: #FF5A70;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ── PANELES DE CONTENIDO ── */
.kfc-tab-panel {
    display: none;
    animation: kfcFade 200ms ease;
}

.kfc-tab-panel.active {
    display: block;
}

@keyframes kfcFade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── CAMPOS DE FORMULARIO LIMPIOS ── */
.kfc-field-wrap {
    margin-bottom: 0.95rem;
    text-align: left;
}

.kfc-field-wrap label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #374151;
    margin-bottom: 0.35rem;
}

:root[data-theme="dark"] .kfc-field-wrap label,
[data-theme="dark"] .kfc-field-wrap label {
    color: #E5E7EB;
}

.kfc-phone-group {
    display: flex;
    gap: 6px;
}

.kfc-prefix-pill {
    background: #F3F4F6;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    padding: 0 0.75rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

:root[data-theme="dark"] .kfc-prefix-pill,
[data-theme="dark"] .kfc-prefix-pill {
    background: #261A14;
    border-color: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

.kfc-input {
    width: 100%;
    padding: 0.72rem 0.85rem;
    border-radius: 10px;
    border: 1.5px solid #E5E7EB;
    background: #F9FAFB;
    font-size: 0.92rem;
    color: #111827;
    box-sizing: border-box;
    font-family: inherit;
    transition: all 160ms ease;
}

:root[data-theme="dark"] .kfc-input,
[data-theme="dark"] .kfc-input {
    background: #200B10;
    border-color: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

.kfc-input:focus {
    border-color: #6B4226;
    background: #FFFFFF;
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 66, 38, 0.15);
}

:root[data-theme="dark"] .kfc-input:focus,
[data-theme="dark"] .kfc-input:focus {
    background: #250E14;
    border-color: #FF5A70;
}

.kfc-input.otp-digits {
    font-size: 1.5rem;
    letter-spacing: 0.5em;
    text-align: center;
    font-weight: 800;
    font-family: var(--font-ui);
    padding: 0.6rem 0.5rem;
}

/* ── BOTONES DE ACCIÓN ── */
.btn-kfc-cta {
    width: 100%;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    border: none;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    text-transform: uppercase;
}

/* Botón Rojo Principal Estilo KFC */
.btn-kfc-cta.red {
    background: #6B4226;
    color: #FFFFFF;
    box-shadow: 0 6px 18px rgba(107, 66, 38, 0.32);
}

.btn-kfc-cta.red:hover {
    background: #55341E;
    box-shadow: 0 10px 24px rgba(107, 66, 38, 0.42);
    transform: translateY(-1.5px);
}

/* Botón Verde WhatsApp */
.btn-kfc-cta.whatsapp {
    background: #25D366;
    color: #FFFFFF;
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.32);
}

.btn-kfc-cta.whatsapp:hover {
    background: #20BD5A;
    box-shadow: 0 10px 24px rgba(37, 211, 102, 0.42);
    transform: translateY(-1.5px);
}

.btn-kfc-cta:active {
    transform: translateY(0);
}

.btn-kfc-cta:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── SEPARADOR "O CONTINÚA CON" ── */
.kfc-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    color: #9CA3AF;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.kfc-divider::before,
.kfc-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #E5E7EB;
}

:root[data-theme="dark"] .kfc-divider::before,
:root[data-theme="dark"] .kfc-divider::after,
[data-theme="dark"] .kfc-divider::before,
[data-theme="dark"] .kfc-divider::after {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.kfc-divider span {
    padding: 0 0.75rem;
}

/* ── BOTÓN OFICIAL DE GOOGLE (ESTÁNDAR GOOGLE BRAND GUIDELINES) ── */
.btn-google-official {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 44px;
    background: #FFFFFF !important;
    color: #1F1F1F !important;
    border: 1px solid #DADCE0 !important;
    border-radius: 22px;
    font-family: 'Roboto', 'Google Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.25px;
    cursor: pointer;
    transition: background-color 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    user-select: none;
    box-sizing: border-box;
}

.btn-google-official:hover {
    background-color: #F8FAFD !important;
    border-color: #D2E3FC !important;
    box-shadow: 0 2px 4px 0 rgba(60,64,67,0.3), 0 2px 6px 2px rgba(60,64,67,0.15);
}

.btn-google-official:active {
    background-color: #EEEEEE !important;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3);
}

.btn-google-official svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ── VISTA LIMPIA ESTILO GOOGLE OAUTH (CERO DATOS FALSOS) ── */
.google-oauth-clean-card {
    display: none;
    text-align: left;
    padding: 0.5rem 0;
    animation: kfcFade 200ms ease;
}

.google-oauth-clean-card.active {
    display: block;
}

.google-oauth-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.google-oauth-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: #202124;
    margin: 0.4rem 0 0.2rem;
    font-family: 'Google Sans', 'Roboto', sans-serif;
}

:root[data-theme="dark"] .google-oauth-title,
[data-theme="dark"] .google-oauth-title {
    color: #FFFFFF;
}

.google-oauth-sub {
    font-size: 0.88rem;
    color: #5F6368;
    margin: 0;
}

:root[data-theme="dark"] .google-oauth-sub,
[data-theme="dark"] .google-oauth-sub {
    color: #9AA0A6;
}

.btn-google-submit {
    width: 100%;
    padding: 0.75rem 1.25rem;
    border-radius: 4px;
    background: #1A73E8;
    color: #FFFFFF;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    border: none;
    cursor: pointer;
    transition: background 150ms ease, box-shadow 150ms ease;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3);
    margin-top: 0.85rem;
}

.btn-google-submit:hover {
    background: #1557B0;
    box-shadow: 0 2px 6px 0 rgba(60,64,67,0.3);
}

.google-oauth-disclaimer {
    font-size: 0.72rem;
    color: #70757A;
    line-height: 1.45;
    margin-top: 1rem;
    padding: 0.65rem 0.75rem;
    background: #F8F9FA;
    border-radius: 6px;
}

:root[data-theme="dark"] .google-oauth-disclaimer,
[data-theme="dark"] .google-oauth-disclaimer {
    background: rgba(255, 255, 255, 0.05);
    color: #9AA0A6;
}

/* ── MENSAJES DE FEEDBACK ── */
.kfc-feedback-box {
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    font-size: 0.82rem;
    margin-bottom: 0.85rem;
    display: none;
    line-height: 1.4;
    text-align: left;
}

.kfc-feedback-box.error {
    display: block;
    background: #FEE2E2;
    border: 1px solid #FCA5A5;
    color: #DC2626;
}

.kfc-feedback-box.success {
    display: block;
    background: #DCFCE7;
    border: 1px solid #86EFAC;
    color: #15803D;
}

/* ── BOTÓN VOLVER / BACK LINK TRANSPARENTE ── */
.btn-auth-back {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: #9AA0A6 !important;
    cursor: pointer;
    font-size: 0.83rem;
    padding: 0.4rem 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 150ms ease, opacity 150ms ease;
}

.btn-auth-back:hover {
    color: #FFFFFF !important;
    text-decoration: underline;
    background: transparent !important;
    background-color: transparent !important;
}

/* ── CONTENEDOR OFICIAL DE GOOGLE IDENTITY SERVICES ── */
.google-official-btn-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    min-height: 44px;
}

/* ── Cambio entre "Ingresar" y "Crear cuenta" ── */
.kfc-switch-view { text-align: center; font-size: 0.84rem; color: #6B7280; margin-top: 1rem; }
.kfc-link-btn { background: none; border: none; padding: 0; font: inherit; font-weight: 800; color: #6B4226; text-decoration: underline; cursor: pointer; }
.kfc-link-btn:hover { filter: brightness(0.85); }
.kfc-link-btn:focus-visible { outline: 2px solid #6B4226; outline-offset: 2px; border-radius: 4px; }
.kfc-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 480px) { .kfc-row-2 { grid-template-columns: 1fr; gap: 0; } }
[data-theme="dark"] .kfc-switch-view { color: #BDB0A8; }