/* ==========================================================================
   afiliarme_mejoras.css — Estilos modernos para el proceso de afiliación
   ========================================================================== */

:root {
    --brand-purple: #5633C1;
    --brand-orange: #FFAA12;
    --brand-orange-light: #FCAA12;
    --bg-light: #f9f7ff;
    --text-dark: #333333;
    --text-muted: #666666;
    --card-shadow: 0 10px 30px rgba(86, 51, 193, 0.08);
    --premium-shadow: 0 15px 45px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 160px;
    /* Evita que el contenido quede bajo el menú fijo durante el scroll */
}

/* 1. PROGRESS BAR / STEP INDICATOR */
.step-progress-container {
    max-width: 800px;
    margin: 40px auto 30px;
    padding: 0 20px;
}

.step-progress {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 0;
    margin: 0;
    list-style: none;
}

.step-progress::before {
    content: "";
    position: absolute;
    top: 25px;
    left: 0;
    height: 4px;
    width: 100%;
    background: #e4dbff;
    z-index: 1;
}

.step-item {
    position: relative;
    z-index: 2;
    text-align: center;
    flex: 1;
}

.step-icon {
    width: 54px;
    height: 54px;
    background: #fff;
    border: 4px solid #e4dbff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: 800;
    color: var(--brand-purple);
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.step-item.active .step-icon {
    border-color: var(--brand-purple);
    background: var(--brand-purple);
    color: #fff;
    box-shadow: 0 8px 20px rgba(86, 51, 193, 0.35);
    transform: scale(1.1);
}

.step-item.completed .step-icon {
    border-color: var(--brand-orange);
    background: var(--brand-orange);
    color: #fff;
}

.step-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--brand-purple);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 2. HERO & VIDEO SECTION */
.hero-afiliarme {
    text-align: center;
    padding: 160px 20px 40px;
    /* Incrementado aún más para pantallas grandes y evitar el menú fijo */
    background: linear-gradient(180deg, #fff 0%, var(--bg-light) 100%);
}

.hero-afiliarme h1 {
    color: var(--brand-purple);
    font-weight: 800;
    font-size: 3rem;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero-afiliarme p {
    color: var(--text-muted);
    font-size: 1.25rem;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.video-premium-wrapper {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, .4);
    background: #000;
    border: 4px solid #fff;
}

.video-premium-wrapper video {
    width: 100%;
    display: block;
}

/* 3. STEP HEADERS */
.step-header {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 35px;
    border-left: 10px solid var(--brand-orange);
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 25px;
    text-align: left;
    transition: var(--transition);
}

.step-header:hover {
    transform: translateX(5px);
}

.step-number {
    font-size: 3rem;
    font-weight: 900;
    color: var(--brand-orange);
    line-height: 1;
    opacity: 0.6;
}

.step-info h3 {
    color: var(--brand-purple);
    font-weight: 800;
    margin-bottom: 6px;
    font-size: 1.5rem;
}

.step-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* 4. MODERN FORMS */
.form-card {
    background: #fff;
    border-radius: 24px;
    padding: 50px;
    box-shadow: var(--premium-shadow);
    max-width: 900px;
    margin: 0 auto;
}

.afiliarme-input {
    background: #fdfcff !important;
    border: 2px solid #e8e4f5 !important;
    border-radius: 16px !important;
    padding: 14px 20px !important;
    font-size: 1rem !important;
    color: #333 !important;
    transition: var(--transition) !important;
    box-shadow: none !important;
    height: auto !important;
    min-height: 56px !important;
}

.afiliarme-input:focus {
    background: #fff !important;
    border-color: var(--brand-purple) !important;
    box-shadow: 0 0 0 5px rgba(86, 51, 193, 0.1) !important;
    transform: translateY(-1px);
}

.afiliarme-input::placeholder {
    color: #aaa;
}

/* 4.1 COBERTURA BOX */
.cobertura-box {
    background: #f8f8fc !important;
    border: 2px solid var(--brand-purple) !important;
    border-radius: 20px !important;
    padding: 30px !important;
    margin: 30px 0 !important;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.02);
}

.cobertura-box h4 {
    color: var(--brand-purple) !important;
    font-weight: 800 !important;
    margin-bottom: 12px;
}

.cobertura-box p {
    color: var(--text-muted) !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
    margin-bottom: 20px;
}

.afiliarme-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235633C1' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
    padding-right: 45px !important;
}

/* 5. MASCOTA CARDS */
.mascota-card {
    background: #fff;
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: var(--card-shadow);
    border: 1px solid #f0eaf8;
    transition: var(--transition);
    max-width: 900px;
    margin: 0 auto;
}

.mascota-card:hover {
    box-shadow: 0 20px 50px rgba(86, 51, 193, 0.12);
    transform: translateY(-5px);
}

.mascota-card h4 {
    color: var(--brand-purple);
    font-weight: 800;
    border-bottom: 2px solid #f0eaf8;
    padding-bottom: 15px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.4rem;
}

.mascota-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.mascota-photo-section {
    grid-column: span 2;
    display: flex;
    gap: 20px;
    align-items: center;
    background: #f8f7ff;
    padding: 25px;
    border-radius: 20px;
    margin-top: 15px;
    border: 1px dashed #d1c5f0;
}

.foto-ejemplo-trigger {
    color: var(--brand-purple);
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
    padding-bottom: 2px;
    border-bottom: 2px solid var(--brand-orange);
    transition: var(--transition);
}

.foto-ejemplo-trigger:hover {
    color: var(--brand-orange);
    border-bottom-color: var(--brand-purple);
}

.quitarMascotaBtn {
    background: #fff5f5 !important;
    color: #e53e3e !important;
    border: 1px solid #fee2e2 !important;
    border-radius: 12px !important;
    padding: 10px 20px !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    box-shadow: 0 4px 6px rgba(229, 62, 62, 0.05);
}

.quitarMascotaBtn:hover {
    background: #e53e3e !important;
    color: #fff !important;
    border-color: #e53e3e !important;
}

/* 6. RESPONSIVE ADJUSTMENTS */
@media (max-width: 768px) {
    .mascota-grid {
        grid-template-columns: 1fr;
    }

    .hero-afiliarme h1 {
        font-size: 2.2rem;
    }

    .hero-afiliarme {
        padding: 40px 15px 20px !important;
    }

    /* 🔥 Optimización Barra de Progreso Mobile */
    .step-progress-container {
        margin: 15px auto 25px !important;
        padding: 0 5px !important;
    }

    .step-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 1rem !important;
        border-width: 3px !important;
        margin-bottom: 5px !important;
    }

    .step-label {
        font-size: 0.68rem !important;
        letter-spacing: -0.2px !important;
    }

    .step-progress::before {
        top: 22px !important;
    }

    .form-card {
        padding: 25px 15px;
        border-radius: 20px;
    }

    .step-progress-container {
        margin: 20px auto 20px;
    }

    .step-header {
        padding: 20px;
        gap: 15px;
    }

    .step-number {
        font-size: 2.2rem;
    }

    .step-info h3 {
        font-size: 1.2rem;
    }
}

/* 7. STEP 3 & FOOTER */
.checkout-footer {
    background: var(--brand-purple);
    border-radius: 30px;
    padding: 50px;
    color: #fff;
    margin-top: 50px;
    box-shadow: 0 20px 60px rgba(86, 51, 193, 0.3);
}

.captcha-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 24px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.terminos-check-wrapper {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.08);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.terminos-check-wrapper input[type="checkbox"] {
    width: 24px;
    height: 24px;
    min-width: 24px;
    accent-color: var(--brand-orange);
    margin-top: 3px;
}

.btn-confirmar-afiliacion {
    width: 100%;
    max-width: 450px;
    padding: 22px !important;
    border-radius: 100px !important;
    font-size: 1.3rem !important;
    background: var(--brand-orange) !important;
    color: #000 !important;
    border: none !important;
    box-shadow: 0 12px 35px rgba(255, 170, 18, 0.4) !important;
    transition: var(--transition) !important;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-confirmar-afiliacion:hover:not(:disabled) {
    transform: translateY(-5px) !important;
    box-shadow: 0 18px 45px rgba(255, 170, 18, 0.6) !important;
    filter: brightness(1.05);
}

.btn-confirmar-afiliacion:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc !important;
    box-shadow: none !important;
}

/* Botón Agregar Mascota — acotado al contenido de la página, NO al menú */
.hero-afiliarme .btn-secondarybis,
.afiliarme-section .btn-secondarybis,
#InscripcionForm .btn-secondarybis,
#mascotasContainer .btn-secondarybis,
.container > .text-center .btn-secondarybis {
    background: #fff !important;
    color: var(--brand-purple) !important;
    border: 3px solid var(--brand-purple) !important;
    border-radius: 50px !important;
    font-weight: 800 !important;
    padding: 15px 40px !important;
    transition: var(--transition) !important;
    box-shadow: var(--card-shadow) !important;
}

.hero-afiliarme .btn-secondarybis:hover,
.afiliarme-section .btn-secondarybis:hover,
#InscripcionForm .btn-secondarybis:hover,
#mascotasContainer .btn-secondarybis:hover,
.container > .text-center .btn-secondarybis:hover {
    background: var(--brand-purple) !important;
    color: #fff !important;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(86, 51, 193, 0.2) !important;
}

/* Misc */
.label-premium {
    color: #555;
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
    font-size: 0.95rem;
}

.alert-modern {
    border-radius: 16px;
    padding: 20px;
    font-weight: 600;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* Modal Foto Example fixes */
#modalFotoEjemplo {
    display: none;
    position: fixed;
    z-index: 100001;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.foto-ejemplo-content {
    background: #fff;
    padding: 30px;
    border-radius: 24px;
    max-width: 450px;
    width: 90%;
    position: relative;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.foto-ejemplo-content img {
    width: 100%;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.foto-ejemplo-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background: var(--brand-orange);
    color: #000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    font-size: 24px;
    font-weight: bold;
}


.form-control.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
    background-color: #fff8f8 !important;
}

.label-premium.text-danger {
    color: #dc3545 !important;
}

/* Soluci�n visibilidad plan en mobile */
.plan-display-name[readonly] {
    background-color: #fdfcff !important;
    opacity: 1 !important;
    color: #333 !important;
    cursor: pointer;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

@media (max-width: 576px) {
    .plan-display-name {
        padding-left: 12px !important;
        padding-right: 12px !important;
        font-size: 0.85rem !important;
    }

    .gap-2 {
        gap: 5px !important;
    }
}

/* =========================
   MOBILE FORZADO REAL - PASO 2
========================= */
@media (max-width: 768px) {

    /* 🔥 Fuerza 1 sola columna SI O SI */
    .mascota-grid {
        display: block !important;
    }

    /* Cada form-group ocupa todo */
    .mascota-grid .form-group {
        width: 100% !important;
        display: block !important;
        margin-bottom: 15px;
    }

    /* 🔥 IMPORTANTE: rompe el span 2 */
    .mascota-photo-section {
        display: block !important;
        width: 100% !important;
    }

    /* Inputs full width */
    .mascota-grid input,
    .mascota-grid select,
    .mascota-grid textarea {
        width: 100% !important;
    }

    /* 🔥 BOTONES PLAN (este suele romper todo) */
    .mascota-grid .d-flex {
        display: block !important;
    }

    .mascota-grid .d-flex input,
    .mascota-grid .d-flex button {
        width: 100% !important;
        margin: 5px 0 !important;
    }

    /* Header de card */
    .mascota-card h4 {
        display: block !important;
    }

    .quitarMascotaBtn {
        width: 100%;
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    .mascota-card {
        padding: 20px !important;
    }

    .mascota-grid .form-group {
        margin-bottom: 12px;
    }

    .afiliarme-input {
        min-height: 48px !important;
        font-size: 14px !important;
    }
}
/* =========================
   SPINNER DE PROCESAMIENTO
========================= */
#processing-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(86, 51, 193, 0.95);
    backdrop-filter: blur(8px);
    z-index: 99999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
}

.spinner-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
}

.spinner-main {
    width: 100%;
    height: 100%;
    border: 6px solid rgba(255, 255, 255, 0.1);
    border-top: 6px solid var(--brand-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-inner {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 90px;
    height: 90px;
    border: 4px solid rgba(255, 255, 255, 0.05);
    border-bottom: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}

.processing-text h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: #fff;
}

.processing-text p {
    font-size: 1.1rem;
    opacity: 0.8;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
