/* ==========================================================================
   isapre-planes.css
   Plantilla reutilizable para /cotizar-planes-{isapre}.
   Usa variables --ip-* inyectadas inline por IsapreLandingController.
   Reutiliza clases del sistema de diseño general (style.css).

   v2 — más presencia del color corporativo de cada isapre a lo largo de
   toda la página (no solo en botones/acentos): barra superior, blob
   decorativo del hero, chips de red de clínicas, línea conectora de pasos,
   bordes de tarjetas y foco de formulario.
   ========================================================================== */

/* ========================================
   1. BASE
   ======================================== */

.isapre-landing .ip-brand {
    color: var(--ip-primary);
}

/* Acento de color bajo cada H2 de la página: repetición visual de marca */
.isapre-landing .section-title h2,
.ip-form-intro h2 {
    position: relative;
    display: inline-block;
}
.isapre-landing .section-title {
    position: relative;
}
.isapre-landing .section-title::before {
    content: "";
    display: block;
    width: 46px;
    height: 4px;
    border-radius: 4px;
    background: var(--ip-primary);
    margin: 0 auto 18px;
}
.isapre-landing .section-title.center::before { margin-left: auto; margin-right: auto; }

.isapre-landing .eyebrow {
    color: var(--ip-primary-dark, var(--ip-primary));
    font-weight: 600;
}
.isapre-landing .eyebrow::before {
    background: var(--ip-primary);
    opacity: 0.7;
}

/* ========================================
   2. BOTONES CTA
   ======================================== */

.ip-btn-cta {
    background: var(--ip-primary);
    color: #FFFFFF;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 34px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.01em;
    transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--ip-primary) 55%, transparent);
}
.ip-btn-cta:hover {
    background: var(--ip-primary-dark);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -8px color-mix(in srgb, var(--ip-primary) 65%, transparent);
}
.ip-btn-cta svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Botón en hero (fondo claro) */
.ip-hero .ip-btn-cta {
    background: var(--ip-color-boton-hero, var(--ip-primary));
    color: var(--ip-color-boton-texto, #FFFFFF);
}
.ip-hero .ip-btn-cta:hover {
    background: var(--ip-primary-dark);
    color: #FFFFFF;
}

.isapre-landing .btn-outline {
    border: 1.5px solid var(--ip-primary);
    color: var(--ip-primary-dark, var(--ip-primary));
    border-radius: 999px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}
.isapre-landing .btn-outline:hover {
    background: var(--ip-primary);
    color: #FFFFFF;
}

/* ========================================
   3. HERO — con barra de marca + blob decorativo + imagen
   ======================================== */

.ip-hero {
    background: var(--ip-gradiente-hero, linear-gradient(135deg, var(--ip-primary) 0%, var(--ip-primary-dark) 100%));
    padding: 0 0 0;
    overflow: hidden;
    color: var(--ip-color-texto-hero, #FFFFFF);
    position: relative;
    border-top: 6px solid var(--ip-primary);
}

/* Blob de color corporativo — asegura presencia de marca aunque el fondo
   configurado para el hero sea neutro (blanco/gris). */
.ip-hero::before {
    content: "";
    position: absolute;
    top: -180px;
    right: -160px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--ip-primary) 22%, transparent) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.ip-hero::after {
    content: "";
    position: absolute;
    bottom: -220px;
    left: -140px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--ip-primary) 12%, transparent) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.ip-hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 50px;
    align-items: center;
    padding: 52px 0 48px;
    position: relative;
    z-index: 2;
}

.ip-hero-text h1 {
    font-size: clamp(2.6rem, 4.6vw, 3.9rem);
    font-weight: 800;
    color: var(--ip-color-texto-hero, #FFFFFF);
    line-height: 1.1;
    margin-bottom: 0.4em;
    letter-spacing: -0.02em;
}

/* Nombre de la isapre con color corporativo */
.ip-hero-text h1 .ip-brand {
    color: var(--ip-primary);
    font-weight: 800;
    position: relative;
    white-space: nowrap;
}
.ip-hero-text h1 .ip-brand::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--ip-primary);
    border-radius: 4px;
    opacity: 0.3;
}

.ip-hero-text .lead {
    font-size: 1.2rem;
    color: var(--ip-color-bajada, #333333);
    max-width: 50ch;
    line-height: 1.6;
    margin-bottom: 1.2em;
}

.ip-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 14px;
    margin-top: 26px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
}
.ip-hero-badges span {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ip-color-texto-hero, #1A1A1A) 6%, transparent);
    color: var(--ip-color-texto-hero, #1A1A1A);
    font-weight: 500;
}
.ip-hero-badges svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--ip-primary);
}

.ip-hero-badges .ip-badge-highlight {
    background: var(--ip-primary);
    color: #FFFFFF;
    font-weight: 600;
}
.ip-hero-badges .ip-badge-highlight svg { color: #FFFFFF; }

.ip-hero-visual {
    position: relative;
    height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.ip-hero-photo {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    background-size: cover;
    background-position: center 18%;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    box-shadow: none;
    border: none;
}

.ip-hero-photo::after { display: none; }

/* ========================================
   STATS — franja con borde superior de marca
   ======================================== */

.ip-stats {
    background: var(--white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: -8px;
    position: relative;
    z-index: 3;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.06);
    border-top: 3px solid var(--ip-primary);
}

.ip-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 30px 0;
}

.ip-stat {
    text-align: center;
    padding: 0 16px;
    border-left: 1px solid var(--line-soft);
}
.ip-stat:first-child {
    border-left: none;
}

.ip-stat-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.9rem;
    color: var(--ip-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.ip-stat-value small {
    font-size: 1rem;
    font-weight: 400;
    color: var(--ink-soft);
}

.ip-stat-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-top: 4px;
}

/* ========================================
   4. BENEFICIOS — tarjetas con borde de marca
   ======================================== */

.ip-benefit-grid {
    margin-top: 8px;
}

.ip-benefit-card {
    text-align: left;
    padding: 30px 26px;
    border-top: 3px solid var(--ip-primary);
    border-radius: 4px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.ip-benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -16px color-mix(in srgb, var(--ip-primary) 30%, transparent);
}

.ip-benefit-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--ip-primary);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}
.ip-benefit-card h3 {
    font-size: 1rem;
    color: var(--ink);
    margin-bottom: 0;
}

/* ========================================
   5. RED DE CLÍNICAS — chips de color corporativo
   ======================================== */

.ip-network-box {
    background: var(--white);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 44px 48px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    transition: box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}
.ip-network-box::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--ip-primary);
}
.ip-network-box:hover {
    box-shadow: 0 24px 48px -20px color-mix(in srgb, var(--ip-primary) 25%, transparent);
}

.ip-network-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ip-primary-dark, var(--ip-primary));
    margin-bottom: 16px;
    font-weight: 700;
}

.ip-network-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.ip-network-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--ip-primary-dark, var(--ink));
    background: var(--ip-primary-light, color-mix(in srgb, var(--ip-primary) 10%, white));
    padding: 8px 14px;
    border-radius: 999px;
    transition: transform 0.2s ease, background 0.2s ease;
}
.ip-network-list li:hover {
    transform: translateY(-2px);
    background: var(--ip-primary);
    color: #FFFFFF;
}
.ip-network-list li:hover svg { color: #FFFFFF; }
.ip-network-list svg {
    width: 14px;
    height: 14px;
    color: var(--ip-primary);
    flex-shrink: 0;
    transition: color 0.2s ease;
}

/* ========================================
   6. PASOS — círculo de marca + línea conectora
   ======================================== */

.steps { position: relative; }
.steps::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 12%;
    right: 12%;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--ip-primary-light, var(--line)) 0 10px, transparent 10px 18px);
    z-index: 0;
}
.step { position: relative; z-index: 1; }

.ip-step-number {
    background: var(--ip-primary) !important;
    color: #FFFFFF !important;
    font-weight: 700;
    box-shadow: 0 0 0 6px var(--paper, #fff) !important;
}

/* ========================================
   7. BANNER ASESORÍA — bloque sólido de marca
   ======================================== */

.ip-advisor-banner {
    background: linear-gradient(120deg, var(--ip-primary) 0%, var(--ip-primary-dark) 100%);
    color: #FFFFFF;
    border-radius: var(--radius-lg);
    padding: 58px 60px;
    text-align: center;
    max-width: 820px;
    margin: 0 auto;
    box-shadow: 0 24px 50px -18px color-mix(in srgb, var(--ip-primary) 55%, transparent);
    position: relative;
    overflow: hidden;
}
.ip-advisor-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(115deg, rgba(255,255,255,0.06) 0 2px, transparent 2px 26px);
    pointer-events: none;
}
.ip-advisor-banner h2 {
    color: #FFFFFF;
    font-size: 1.9rem;
    position: relative;
}
.ip-advisor-banner p {
    color: rgba(255, 255, 255, 0.88);
    max-width: 56ch;
    margin: 0 auto 28px;
    font-size: 1.05rem;
    line-height: 1.6;
    position: relative;
}
.ip-advisor-btn {
    background: #FFFFFF;
    color: var(--ip-primary-dark) !important;
    border-color: #FFFFFF;
    position: relative;
}
.ip-advisor-btn:hover {
    background: transparent;
    color: #FFFFFF !important;
    border-color: rgba(255, 255, 255, 0.6);
}
.ip-advisor-btn svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   8. FORMULARIO
   ======================================== */

.ip-form-section {
    background: var(--paper-alt);
    position: relative;
}

.ip-form-grid {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
    gap: 50px;
    align-items: start;
}

.ip-form-intro h2 {
    margin-top: 4px;
}
.ip-form-intro h2 .ip-brand {
    color: var(--ip-primary);
}

.ip-form-checklist {
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
    display: grid;
    gap: 14px;
}
.ip-form-checklist li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.92rem;
    color: var(--ink-soft);
    line-height: 1.4;
}
.ip-form-checklist svg {
    width: 18px;
    height: 18px;
    color: var(--ip-primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.ip-form-box {
    box-shadow: 0 30px 60px -24px color-mix(in srgb, var(--ip-primary) 30%, rgba(0,0,0,0.2));
    background: var(--white);
    padding: 34px 36px;
    border-top: 4px solid var(--ip-primary);
    border-radius: 4px;
}

.ip-form-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--ip-primary-dark, var(--ip-primary));
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--ip-primary-light, var(--line-soft));
}
.ip-form-subtitle {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ip-primary);
    margin: 6px 0 -4px;
    grid-column: 1 / -1;
    padding-top: 12px;
}

.isapre-landing .form-group input:focus,
.isapre-landing .form-group select:focus,
.isapre-landing .form-group textarea:focus {
    border-color: var(--ip-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ip-primary) 16%, transparent);
}

.ip-btn-submit {
    width: 100%;
    justify-content: center;
    padding: 16px 32px;
    font-size: 1.05rem;
}

/* ========================================
   9. RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .ip-network-box {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .ip-network-list {
        grid-template-columns: 1fr 1fr;
    }

    .ip-hero-visual {
        height: 420px;
    }
    .ip-hero-photo {
        background-position: center 15%;
    }
}

@media (max-width: 820px) {
    .ip-hero-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding-bottom: 32px;
    }

    .ip-hero-visual {
        height: 350px;
        order: -1;
    }

    .ip-hero-photo {
        border-radius: 0;
        background-position: center 12%;
    }

    .ip-hero-text h1 {
        font-size: clamp(2rem, 4.5vw, 2.8rem);
    }

    .ip-hero-text .lead {
        font-size: 1.05rem;
    }

    .ip-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px 0;
        padding: 20px 0;
    }
    .ip-stat:nth-child(3) {
        border-left: none;
    }

    .ip-form-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .ip-form-box {
        padding: 24px 20px;
    }

    .ip-advisor-banner {
        padding: 36px 24px;
    }
    .ip-advisor-banner h2 {
        font-size: 1.4rem;
    }

    .ip-network-box {
        padding: 24px 20px;
    }
    .ip-network-list {
        grid-template-columns: 1fr;
    }

    .ip-hero-badges {
        gap: 12px 20px;
        font-size: 0.72rem;
    }
}

@media (max-width: 480px) {
    .ip-hero {
        padding-top: 32px;
    }

    .ip-hero-text h1 {
        font-size: 1.8rem;
    }

    .ip-hero-text .lead {
        font-size: 0.95rem;
    }

    .ip-hero-visual {
        height: 280px;
    }

    .ip-hero-photo {
        background-position: center 8%;
    }

    .ip-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px 0;
    }
    .ip-stat-value {
        font-size: 1.4rem;
    }

    .ip-form-grid {
        gap: 24px;
    }

    .ip-form-box {
        padding: 20px 16px;
    }

    .ip-btn-cta {
        padding: 12px 24px;
        font-size: 0.9rem;
    }

    .ip-advisor-banner {
        padding: 28px 16px;
    }
    .ip-advisor-banner h2 {
        font-size: 1.2rem;
    }

    .ip-hero-badges {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    .ip-hero-badges .ip-badge-highlight {
        padding: 4px 12px;
    }
}
/* ========================================
   10. FORMULARIO EN 2 PASOS
   ======================================== */

.ip-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 28px;
}

.ip-progress-step {
    display: flex;
    align-items: center;
    gap: 9px;
    opacity: 0.45;
    transition: opacity 0.3s ease;
}
.ip-progress-step.is-active,
.ip-progress-step.is-done { opacity: 1; }

.ip-progress-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--paper-alt, #EAF0EA);
    color: var(--ink-soft, #5B6167);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.ip-progress-step.is-active .ip-progress-dot {
    background: var(--ip-primary);
    color: #FFFFFF;
    transform: scale(1.08);
}
.ip-progress-step.is-done .ip-progress-dot {
    background: var(--ip-primary);
    color: #FFFFFF;
}
.ip-progress-step.is-done .ip-progress-dot::before {
    content: "✓";
}
.ip-progress-step.is-done .ip-progress-dot span { display: none; }

.ip-progress-label {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.02em;
    color: var(--ink-soft, #5B6167);
    white-space: nowrap;
}
.ip-progress-step.is-active .ip-progress-label { color: var(--ink, #1A1A1A); font-weight: 600; }

.ip-progress-line {
    flex: 1;
    height: 2px;
    background: var(--line-soft, rgba(0,0,0,0.08));
    border-radius: 2px;
    overflow: hidden;
}
.ip-progress-line span {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--ip-primary);
    transition: width 0.5s ease;
}
.ip-progress[aria-valuenow="2"] .ip-progress-line span { width: 100%; }

/* Paneles de paso: transición suave al avanzar/retroceder */
.form-step {
    animation: ipStepIn 0.4s ease both;
}
@keyframes ipStepIn {
    from { opacity: 0; transform: translateX(14px); }
    to   { opacity: 1; transform: translateX(0); }
}

.ip-step-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 26px;
}
.ip-step-actions:has(.ip-btn-submit:only-child) { justify-content: center; }

.ip-step-hint {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--ink-soft, #5B6167);
}

#btn-paso2-atras {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
#btn-paso2-atras svg { width: 16px; height: 16px; }

/* Deshabilitado mientras se guarda el paso 1 por AJAX */
.ip-btn-submit[disabled] {
    opacity: 0.65;
    cursor: wait;
    pointer-events: none;
}
.ip-btn-submit .ip-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    display: inline-block;
    animation: ipSpin 0.7s linear infinite;
}
@keyframes ipSpin { to { transform: rotate(360deg); } }

/* ========================================
   11. SCROLL REVEAL + MICRO-INTERACCIONES
   (página "viva", con prefers-reduced-motion respetado)
   ======================================== */

.ip-reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: var(--ip-delay, 0s);
}
.ip-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.ip-network-list li {
    transition: transform 0.2s ease, color 0.2s ease;
}
.ip-network-list li:hover {
    transform: translateX(4px);
    color: var(--ink, #1A1A1A);
}

.ip-hero-photo {
    animation: ipHeroFade 0.9s ease both;
}
@keyframes ipHeroFade {
    from { opacity: 0; transform: scale(1.03); }
    to   { opacity: 1; transform: scale(1); }
}

.ip-hero-badges .ip-badge-highlight {
    animation: ipPulse 2.6s ease-in-out infinite;
}
@keyframes ipPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.35); }
    50%      { box-shadow: 0 0 0 6px rgba(255,255,255,0); }
}

@media (prefers-reduced-motion: reduce) {
    .ip-reveal { opacity: 1; transform: none; transition: none; }
    .ip-hero-photo { animation: none; }
    .ip-hero-badges .ip-badge-highlight { animation: none; }
    .form-step { animation: none; }
    .ip-btn-submit .ip-spinner { animation: none; }
}

@media (max-width: 640px) {
    .ip-progress-label { display: none; }
    .ip-step-actions { flex-direction: column-reverse; align-items: stretch; }
    .ip-step-hint { text-align: center; }
}
