:root {
        --primary: #0066cc;
        --primary-dark: #0052a3;
        --secondary: #af7efa;
        --accent: #a33cf8;
        --background: #ecf5fe;
        --foreground: #011326;
    }
    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
        background: var(--background);
        color: var(--foreground);
        font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
        min-height: 100vh;
    }
    
    .plans-page { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
    
    /* Status Banner */
    .status-banner {
        padding: 14px 24px;
        border-radius: 0 0 12px 12px;
        font-weight: 500;
        max-width: 1100px;
        margin: 0 auto 24px;
    }
    .banner-warning { background: #fef3c7; border-left: 4px solid #f59e0b; color: #92400e; }
    .banner-error { background: #fee2e2; border-left: 4px solid #ef4444; color: #dc2626; }
    .banner-info { background: #dbeafe; border-left: 4px solid #3b82f6; color: #1e40af; }
    .banner-success { background: #dcfce7; border-left: 4px solid #16a34a; color: #16a34a; }
    
    /* Plans Container */
    .plans-container {
        background: white;
        border-radius: 24px;
        box-shadow: 0 8px 40px rgba(0,102,204,0.08);
        padding: 60px 40px 48px;
        max-width: 1100px;
        margin: 0 auto;
    }
    .gradient-title {
        font-size: 2.8rem;
        font-weight: 700;
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        text-align: center;
    }
    .subtitle {
        color: #5a6a7a;
        font-size: 1.15rem;
        text-align: center;
        margin-top: 12px;
    }
    
    /* Billing Toggle */
    .toggle-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 16px;
        margin-top: 32px;
    }
    .toggle-label {
        font-weight: 400;
        color: #7a8a9a;
        cursor: pointer;
        transition: all 0.2s;
    }
    .toggle-label.active {
        font-weight: 700;
        color: var(--foreground);
    }
    .toggle-wrapper {
        position: relative;
        display: inline-block;
    }
    .toggle-input {
        opacity: 0;
        width: 0;
        height: 0;
        position: absolute;
    }
    .toggle-pill {
        width: 56px;
        height: 28px;
        background: #e2e8f0;
        border-radius: 14px;
        position: relative;
        display: inline-block;
        cursor: pointer;
        transition: background 0.3s;
    }
    .toggle-pill::after {
        content: '';
        position: absolute;
        top: 2px;
        left: 2px;
        width: 24px;
        height: 24px;
        background: white;
        border-radius: 50%;
        transition: left 0.3s;
        box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    }
    .toggle-input:checked + .toggle-pill {
        background: var(--primary);
    }
    .toggle-input:checked + .toggle-pill::after {
        left: 30px;
    }
    .save-badge {
        background: #dcfce7;
        color: #16a34a;
        font-size: 0.72rem;
        padding: 2px 8px;
        border-radius: 99px;
        margin-left: 4px;
    }
    
    /* Cards Grid */
    .cards-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
        margin-top: 40px;
    }
    
    /* Plan Card */
    .plan-card {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 20px;
        padding: 36px 28px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.05);
        position: relative;
        display: flex;
        flex-direction: column;
        animation: cardEntrance 0.5s ease-out forwards;
        opacity: 0;
    }
    .plan-card:nth-child(1) { animation-delay: 0s; }
    .plan-card:nth-child(2) { animation-delay: 0.1s; }
    .plan-card:nth-child(3) { animation-delay: 0.2s; }
    .plan-card:nth-child(4) { animation-delay: 0.3s; }
    
    .plan-popular {
        border: 2px solid var(--secondary);
        box-shadow: 0 12px 40px rgba(175,126,250,0.18);
        transform: scale(1.04);
    }
    
    .plan-custom {
        border: 2px solid var(--secondary);
        background: linear-gradient(135deg, #f0f7ff, #e6f2ff);
        box-shadow: 0 8px 32px rgba(0, 102, 204, 0.12);
    }
    
    .popular-badge {
        position: absolute;
        top: -14px;
        left: 50%;
        transform: translateX(-50%);
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: white;
        padding: 5px 20px;
        border-radius: 99px;
        font-size: 0.78rem;
        font-weight: 700;
        text-transform: uppercase;
        box-shadow: 0 4px 12px rgba(175,126,250,0.4);
    }
    
    .custom-badge {
        position: absolute;
        top: -14px;
        left: 50%;
        transform: translateX(-50%);
        background: linear-gradient(135deg, var(--primary), var(--accent));
        color: white;
        padding: 5px 20px;
        border-radius: 99px;
        font-size: 0.78rem;
        font-weight: 700;
        text-transform: uppercase;
        box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
    }
    
    .plan-name {
        font-size: 1.25rem;
        font-weight: 700;
        margin-bottom: 16px;
    }
    .price-area {
        min-height: 70px;
    }
    .price-limited {
        font-size: 1.6rem;
        font-weight: 700;
        color: var(--foreground);
    }
    .price-custom {
        /* Make contact/pricing text dark like other plans */
        font-size: 1.4rem;
        font-weight: 700;
        color: var(--foreground);
        text-align: center;
    }
    .price-sub {
        color: #7a8a9a;
        font-size: 0.85rem;
        margin-top: 4px;
    }
    .price-block { display: block; }
    .price-amount {
        font-size: 2.2rem;
        font-weight: 800;
        color: var(--foreground);
    }
    .price-suffix {
        font-size: 0.95rem;
        color: #7a8a9a;
    }
    .divider {
        border: none;
        border-top: 1px solid #eee;
        margin: 24px 0;
    }
    .feature-row {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 10px;
    }
    .feature-check {
        color: var(--primary);
        font-weight: 700;
    }
    .feature-text {
        font-size: 0.95rem;
        color: var(--foreground);
    }
    
    /* Buttons */
    .plan-card-actions {
        margin-top: auto;
        padding-top: 24px;
    }

    .btn-primary-plan {
        display: block;
        width: 100%;
        background: var(--primary);
        color: white;
        border: none;
        padding: 12px;
        border-radius: 12px;
        font-weight: 600;
        text-align: center;
        text-decoration: none;
        box-shadow: 0 4px 14px rgba(0,102,204,0.25);
        transition: all 0.2s;
        margin-top: 0;
    }
    .btn-primary-plan:hover {
        background: var(--accent);
        color: white;
        transform: scale(1.02);
    }
    .btn-primary-gradient {
        background: linear-gradient(135deg, var(--primary), var(--accent));
        padding: 14px;
    }
    .btn-secondary-plan {
        display: block;
        width: 100%;
        background: transparent;
        border: 2px solid var(--accent);
        color: var(--accent);
        padding: 12px;
        border-radius: 12px;
        font-weight: 600;
        text-align: center;
        text-decoration: none;
        transition: all 0.2s;
        margin-top: 0;
    }
    .btn-secondary-plan:hover {
        background: var(--accent);
        color: white;
        box-shadow: 0 4px 14px rgba(163,60,248,0.3);
    }
    
    .btn-custom-plan {
        display: block;
        width: 100%;
        background: linear-gradient(135deg, var(--primary), var(--accent));
        color: white;
        border: none;
        padding: 12px;
        border-radius: 12px;
        font-weight: 600;
        text-align: center;
        text-decoration: none;
        box-shadow: 0 4px 14px rgba(0, 102, 204, 0.25);
        transition: all 0.2s;
        margin-top: 0;
    }
    .btn-custom-plan:hover {
        background: linear-gradient(135deg, var(--primary-dark), var(--accent));
        color: white;
        transform: scale(1.02);
        box-shadow: 0 6px 20px rgba(0, 102, 204, 0.35);
    }
    
    .btn-note {
        color: #7a8a9a;
        font-size: 0.8rem;
        text-align: center;
        margin-top: 8px;
        line-height: 1.45;
    }

    .btn-note-line {
        display: block;
    }
    
    /* Animations */
    @keyframes cardEntrance {
        from { opacity: 0; transform: translateY(28px); }
        to { opacity: 1; transform: translateY(0); }
    }
    @keyframes priceFade {
        from { opacity: 0; transform: translateY(-5px); }
        to { opacity: 1; transform: translateY(0); }
    }
    .price-switch {
        animation: priceFade 0.3s ease;
    }
    
    /* Responsive */
    @media (max-width: 1024px) {
        .cards-grid { grid-template-columns: repeat(2, 1fr); }
        .plan-popular { transform: scale(1) !important; }
        .gradient-title { font-size: 2.2rem; }
    }
    @media (max-width: 640px) {
        .cards-grid { grid-template-columns: 1fr; }
        .gradient-title { font-size: 1.8rem; }
        .plans-container { padding: 36px 20px 32px; }
        .plan-card { padding: 28px 20px; }
    }

    .plan-card.plan-custom .plan-name {
        /* Use foreground (dark) color to match other plan titles */
        color: var(--foreground);
    }

    /* Improve custom button hover contrast */
    .btn-custom-plan:hover,
    .btn-custom-plan:focus,
    .btn-custom-plan:active {
        background: linear-gradient(135deg, var(--primary-dark), var(--accent));
        color: #ffffff !important;
        transform: scale(1.02);
        box-shadow: 0 8px 28px rgba(0, 82, 163, 0.35);
        text-shadow: 0 1px 0 rgba(0,0,0,0.15);
    }

    /* Ensure link buttons keep white text on lighter backgrounds */
    .btn-custom-plan,
    .btn-primary-plan {
        color: #ffffff !important;
    }

    /* Keep secondary (freemium) button using accent color so text remains visible on light background */
    .btn-secondary-plan {
        color: var(--accent);
    }

    /* Ensure secondary button text becomes white on hover (overrides base color) */
    .btn-secondary-plan:hover,
    .btn-secondary-plan:focus,
    .btn-secondary-plan:active {
        color: #ffffff !important;
    }

    .toggle-input:focus-visible + .toggle-pill { outline: 2px solid #4f46e5; outline-offset: 3px; }
