/**
 * Plans Purchase Module - Frontend Styles
 * Fase 1: Vista de Planes
 * Version: 1.0
 */

/* ===================================
   Pricing Section - fondo claro, las tarjetas respiran
   =================================== */
.pricing-section {
    background-color: #f8fafc;
}

/* La pagina de pricing necesita mas ancho que el resto del sitio para que
   los 4 planes "Paquetes" (5/10 procesos x Estandar/Destacado) entren en
   una sola fila sin quedar apretados. */
.pricing-section .auto-container {
    max-width: 1500px;
}

/* ===================================
   Controles unificados: Individuales/Paquetes + switch de Tests
   =================================== */
.plan-view-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 0 auto 2.5rem;
}

.plan-volume-toggle {
    background: #e8e9eb;
    border-radius: 50px;
    padding: 2px;
    display: inline-flex;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.plan-volume-toggle button {
    border: none;
    background: transparent;
    color: #3c3c43;
    padding: 0.6rem 1.75rem;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.plan-volume-toggle button:hover {
    color: #1c1c1e;
}

.plan-volume-toggle button.active {
    color: #fff;
    background: #0d2b3f;
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.12),
        0 3px 1px rgba(0, 0, 0, 0.04);
}

.plan-tests-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #3c3c43;
    cursor: pointer;
    user-select: none;
}

.plan-tests-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.plan-tests-switch .switch-track {
    position: relative;
    width: 42px;
    height: 24px;
    background: #dfe3e8;
    border-radius: 24px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.plan-tests-switch .switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.plan-tests-switch input:checked + .switch-track {
    background: #30a5bf;
}

.plan-tests-switch input:checked + .switch-track .switch-thumb {
    transform: translateX(18px);
}

/* ===================================
   Tab Content
   =================================== */
.plan-tabs-content {
    margin-top: 0;
}

.plans-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0rem;
    justify-content: center;
}

.plans-grid-packages .plan-card {
    padding: 2rem 1.25rem;
}

.plans-grid-packages .plan-price .amount {
    font-size: 2.75rem;
}

/* ===================================
   Plan Card
   =================================== */
.plan-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.plan-card:hover,
.plan-card.hovered {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: #30a5bf;
}

.plan-card.recommended {
    border-color: #30a5bf;
    border-width: 2px;
}

/* Plan Badge */
.plan-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background-color: #30a5bf;
    color: #fff;
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(48, 165, 191, 0.35);
}

/* Plan Icon */
.plan-icon {
    font-size: 3.5rem;
    color: #667eea;
    margin-bottom: 1.5rem;
}

.plan-card.recommended .plan-icon {
    color: #30a5bf;
}

/* Plan Name */
.plan-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0d2b3f;
    margin-bottom: 0.35rem;
    line-height: 1.3;
    text-align: left;
}

/* Plan Quality Tier (Estandar/Destacado/Premium + Video) */
.plan-quality-tier {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 1.1rem;
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
    text-align: left;
}

.plan-quality-tier.tier-estandar {
    background: #eef0f2;
    color: #495057;
}

.plan-quality-tier.tier-destacado {
    background: #f3e8ff;
    color: #7c3aed;
}

.plan-quality-tier.tier-premium_video {
    background: #dcfce7;
    color: #15803d;
}

/* Plan Price */
.plan-price {
    margin-bottom: 2rem;
    color: #0d2b3f;
    text-align: left;
}

.plan-price .currency {
    font-size: 1.5rem;
    font-weight: 600;
    vertical-align: super;
}

.plan-price .amount {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
}

.plan-price .period {
    font-size: 1.2rem;
    color: #0d2b3f;
    font-weight: 700;
    display: block;
    margin-top: 0.5rem;
}

.plan-savings {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.plan-savings .price-before {
    font-size: 0.9rem;
    font-weight: 600;
    color: #94a3b8;
    text-decoration: line-through;
}

.plan-savings .savings-badge {
    display: inline-block;
    background: #dcfce7;
    color: #15803d;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    white-space: nowrap;
}

/* Plan Features */
.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    flex-grow: 1;
    text-align: left;
}

.plan-features li {
    padding: 0.75rem 0;
    color: #4a5568;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.plan-features li i {
    color: #28a745;
    font-size: 1.1rem;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.plan-features li.feature-highlight {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f4 100%);
    padding: 1rem;
    border-radius: 8px;
    margin: 0.5rem 0;
    font-weight: 600;
}

.plan-features li.feature-highlight i {
    color: #28a745;
    font-size: 1.3rem;
}

/* Plan Footer */
.plan-footer {
    margin-top: auto;
    padding-bottom: 1.5rem;
}

.plan-footer .btn {
    width: 100%;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-acquire,
.plan-footer .btn.btn-acquire {
    background-color: #0d2b3f !important;
    border: none !important;
    color: #fff !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 8px !important;
}

.btn-acquire:hover,
.plan-footer .btn.btn-acquire:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(13, 43, 63, 0.3);
    background-color: #0d2b3f !important;
    color: #fff !important;
}

/* El plan recomendado destaca su CTA en turquesa, el resto se queda en navy */
.plan-card.recommended .btn-acquire,
.plan-card.recommended .plan-footer .btn.btn-acquire {
    background-color: #30a5bf !important;
}

.plan-card.recommended .btn-acquire:hover,
.plan-card.recommended .plan-footer .btn.btn-acquire:hover {
    box-shadow: 0 8px 16px rgba(48, 165, 191, 0.4);
    background-color: #30a5bf !important;
    color: #fff !important;
}

.btn-current-plan {
    background: #f8f9fa;
    border: 2px solid #0d2b3f;
    color: #0d2b3f;
}

.btn-current-plan:hover {
    background: #0d2b3f;
    color: #fff;
}

/* ===================================
   Custom Plan Section
   =================================== */
.custom-plan-section {
    padding: 0;
    margin: 0;
    margin-top: 1rem;
}

.custom-plan-card {
    background-color: #fff;
    color: #0d2b3f;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    margin: 0 auto;
    max-width: 720px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.custom-plan-card-inner {
    padding: 2.5rem 3rem;
    text-align: center;
}

.custom-plan-badge {
    display: inline-block;
    background: #0d2b3f;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    margin-bottom: 1.25rem;
}

.custom-plan-card h4 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #0d2b3f;
}

.custom-plan-card p {
    font-size: 1rem;
    margin: 0 auto 1.5rem;
    max-width: 520px;
    color: #4a5568;
    line-height: 1.6;
}

.custom-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 auto 1.75rem;
    display: inline-flex;
    flex-direction: column;
    gap: 0.6rem;
    text-align: left;
}

.custom-plan-features li {
    color: #4a5568;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.custom-plan-features li i {
    color: #28a745;
}

.btn-custom-plan {
    background: #30a5bf;
    color: #fff;
    padding: 1rem 2.5rem;
    font-weight: 700;
    border-radius: 20px;
    border: none;
    transition: all 0.3s ease;
}

.btn-custom-plan:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    color: #fff;
}

.btn-custom-plan i {
    margin-right: 0.5rem;
}

/* ===================================
   Compare Plans Button
   =================================== */
.btn-compare-plans {
    color: #6c757d;
    font-size: 0.95rem;
    text-decoration: none;
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-compare-plans:hover {
    color: #6c757d;
    text-decoration: none;
}

.btn-compare-plans i {
    margin-right: 0.5rem;
}

/* ===================================
   Responsive Design
   =================================== */

/* Tablets */
@media (max-width: 992px) {
    .plan-card {
        margin-bottom: 2rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .plan-view-controls {
        flex-direction: column;
        gap: 1rem;
    }

    .plan-volume-toggle {
        width: 100%;
    }

    .plan-volume-toggle button {
        flex: 1;
    }

    .plan-card {
        padding: 2rem 1.5rem;
    }

    .plan-name {
        font-size: 1.5rem;
    }

    .plan-price .amount {
        font-size: 2.5rem;
    }

    .custom-plan-card-inner {
        padding: 2rem 1.5rem;
    }

    .custom-plan-card h4 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .plans-grid {
        gap: 1.5rem;
    }

    .plan-card {
        margin-bottom: 1.5rem;
    }

    .plan-icon {
        font-size: 2.5rem;
    }

    .plan-features li {
        font-size: 0.9rem;
    }
}

/* ===================================
   Animations
   =================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.plan-card {
    animation: fadeInUp 0.6s ease-out;
}

.plan-card:nth-child(1) {
    animation-delay: 0.1s;
}

.plan-card:nth-child(2) {
    animation-delay: 0.2s;
}

.plan-card:nth-child(3) {
    animation-delay: 0.3s;
}

.plan-card:nth-child(4) {
    animation-delay: 0.4s;
}

/* Loading State */
.btn-acquire:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-acquire .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===================================
   Print Styles
   =================================== */
@media print {
    .custom-plan-section,
    .btn-compare-plans,
    .plan-footer {
        display: none;
    }

    .plan-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}
