/**
 * AICT Pricing Page Styles
 * High-contrast, Zapier-inspired design
 *
 * @package AICT_Core
 * @since 1.7.0
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --pricing-bg: #ffffff;
    --pricing-text: #1a1a2e;
    --pricing-text-muted: #4a4a68;
    --pricing-border: #e2e8f0;
    --pricing-accent: #6366f1;
    --pricing-accent-hover: #e55a2b;
    --pricing-success: #10b981;
    --pricing-card-bg: #ffffff;
    --pricing-card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --pricing-featured-bg: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
    --pricing-featured-text: #ffffff;
}

/* ==========================================================================
   Base Layout
   ========================================================================== */
.pricing-header,
.pricing-section,
.enterprise-section,
.comparison-section,
.guarantee-section,
.faq-section,
.final-cta-section {
    padding: 4rem 1.5rem;
    background: var(--pricing-bg);
}

/* Reduce gap between pricing header and pricing grid sections */
.pricing-header + .pricing-section {
    padding-top: 0;
}

.pricing-header {
    text-align: center;
    padding-bottom: 2rem;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    padding-top: 5rem;
}

.pricing-header h1 {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--pricing-text);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.pricing-header > .container > p {
    font-size: 1.25rem;
    color: var(--pricing-text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

/* ==========================================================================
   Billing Toggle
   ========================================================================== */
.pricing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.pricing-toggle span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--pricing-text-muted);
    cursor: pointer;
    user-select: none;
}

.toggle-switch {
    width: 56px;
    height: 28px;
    background: #e2e8f0;
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: #ffffff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch.annual {
    background: var(--pricing-accent);
}

.toggle-switch.annual::after {
    transform: translateX(28px);
}

.save-badge {
    background: var(--pricing-success);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   Pricing Cards Grid
   ========================================================================== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--pricing-card-bg);
    border: 2px solid var(--pricing-border);
    border-radius: 16px;
    padding: 2.5rem;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--pricing-card-shadow);
}

/* Featured Card (Pro) */
.pricing-card.featured {
    background: var(--pricing-featured-bg);
    border-color: transparent;
    color: var(--pricing-featured-text);
}

.pricing-card.featured .plan-name,
.pricing-card.featured .price-amount,
.pricing-card.featured .price-period,
.pricing-card.featured .plan-highlight,
.pricing-card.featured .plan-features li,
.pricing-card.featured .best-for h4,
.pricing-card.featured .best-for li {
    color: var(--pricing-featured-text);
}

.pricing-card.featured .plan-features li.disabled {
    color: rgba(255, 255, 255, 0.5);
}

.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--pricing-accent);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pricing-text);
    margin-bottom: 1rem;
}

.plan-price {
    margin-bottom: 1.5rem;
}

.price-amount {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--pricing-text);
    line-height: 1;
}

.price-period {
    font-size: 1rem;
    color: var(--pricing-text-muted);
    font-weight: 500;
}

.plan-highlight {
    background: rgba(255, 107, 53, 0.1);
    color: var(--pricing-accent);
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pricing-card.featured .plan-highlight {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

/* ==========================================================================
   Feature List
   ========================================================================== */
.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
}

.plan-features li {
    padding: 0.625rem 0;
    padding-left: 1.75rem;
    position: relative;
    font-size: 0.9375rem;
    color: var(--pricing-text);
    border-bottom: 1px solid var(--pricing-border);
}

.plan-features li:last-child {
    border-bottom: none;
}

.plan-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--pricing-success);
    font-weight: 700;
}

.plan-features li.disabled {
    color: var(--pricing-text-muted);
    opacity: 0.6;
}

.plan-features li.disabled::before {
    content: '✗';
    color: #9ca3af;
}

.pricing-card.featured .plan-features li {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   CTA Buttons
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    border: none;
}

.btn-primary {
    background: var(--pricing-accent);
    color: #ffffff !important;
}

.btn-primary:hover {
    background: var(--pricing-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--pricing-text) !important;
    border: 2px solid var(--pricing-border);
}

.btn-secondary:hover {
    border-color: var(--pricing-accent);
    color: var(--pricing-accent) !important;
}

.pricing-card.featured .btn-secondary {
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff !important;
}

.pricing-card.featured .btn-secondary:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.plan-cta {
    width: 100%;
    margin-top: 1rem;
}

/* ==========================================================================
   Best For Section
   ========================================================================== */
.best-for {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--pricing-border);
}

.pricing-card.featured .best-for {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.best-for h4 {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--pricing-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

.best-for ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.best-for li {
    font-size: 0.875rem;
    color: var(--pricing-text-muted);
    padding: 0.25rem 0;
}

/* ==========================================================================
   Enterprise Section
   ========================================================================== */
.enterprise-section {
    background: #f8fafc;
}

.enterprise-card {
    background: var(--pricing-card-bg);
    border: 2px solid var(--pricing-border);
    border-radius: 16px;
    padding: 3rem;
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 2rem;
    align-items: center;
}

.enterprise-content h2 {
    font-size: 1.75rem;
    line-height: 1.3;
    font-weight: 700;
    color: var(--pricing-text);
    margin-bottom: 0.5rem;
}

.enterprise-content p {
    color: var(--pricing-text-muted);
    margin: 0;
}

.enterprise-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.enterprise-feature {
    font-size: 0.875rem;
    color: var(--pricing-success);
    font-weight: 500;
}

/* ==========================================================================
   Comparison Table
   ========================================================================== */
.comparison-section {
    background: #ffffff;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--pricing-text);
    text-align: center;
    margin-bottom: 3rem;
}

.comparison-table {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-collapse: collapse;
    background: var(--pricing-card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--pricing-card-shadow);
}

.comparison-table th,
.comparison-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--pricing-border);
}

.comparison-table th {
    background: var(--pricing-text);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comparison-table th:not(:first-child) {
    text-align: center;
}

.comparison-table td:not(:first-child) {
    text-align: center;
    font-weight: 500;
}

.comparison-table tbody tr:hover {
    background: #f8fafc;
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.check-icon {
    color: var(--pricing-success);
    font-size: 1.25rem;
}

.cross-icon {
    color: #9ca3af;
    font-size: 1.25rem;
}

/* ==========================================================================
   Guarantee Section
   ========================================================================== */
.guarantee-section {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
}

.guarantee-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.guarantee-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.guarantee-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.guarantee-content p {
    font-size: 1.125rem;
    opacity: 0.9;
    line-height: 1.6;
}

/* ==========================================================================
   FAQ Section
   ========================================================================== */
.faq-section {
    background: #f8fafc;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.faq-item {
    background: var(--pricing-card-bg);
    border: 1px solid var(--pricing-border);
    border-radius: 12px;
    padding: 1.5rem;
}

.faq-item h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--pricing-text);
    margin-bottom: 0.75rem;
}

.faq-item p {
    font-size: 0.9375rem;
    color: var(--pricing-text-muted);
    line-height: 1.6;
    margin: 0;
}

/* ==========================================================================
   Final CTA Section
   ========================================================================== */
.final-cta-section {
    background: var(--pricing-text);
    color: #ffffff;
    text-align: center;
}

.final-cta-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.final-cta-section .text-gray {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
}

.cta-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

.cta-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
}

.cta-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cta-card p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9375rem;
    margin: 0;
}

.trust-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.trust-badge {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .pricing-header h1 {
        font-size: 2rem;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .enterprise-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .enterprise-features {
        justify-content: center;
    }

    .comparison-table {
        font-size: 0.875rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }

    .final-cta-section h2 {
        font-size: 1.75rem;
    }

    .cta-cards {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Animation
   ========================================================================== */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }

/* ==========================================================================
   Loading State for Checkout
   ========================================================================== */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.btn.loading::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}
