/* ============================================================
   mindAI — Тарифы Design System v2
   Style: Dark Luxury × AI-Wellness
   ============================================================ */

/* ---- Tokens ---- */
:root {
    --night:   #070b18;
    --deep:    #0d1226;
    --surface: #141930;
    --card:    rgba(20,25,48,0.65);
    --primary:       #9b87f5;
    --primary-light: #b5a4ff;
    --primary-dark:  #6b5bbf;
    --rose:          #e879a0;
    --aurora:        #67e8c8;
    --gold:          #f5c842;
    --text:   #eef0ff;
    --text-2: #a8adc8;
    --text-3: #636882;
    --inv:    #0d1226;
    --border:  rgba(160,140,255,0.14);
    --border2: rgba(160,140,255,0.26);
    --r-sm:   12px;
    --r-md:   20px;
    --r-lg:   32px;
    --r-xl:   48px;
    --r-pill: 999px;
    --expo: cubic-bezier(0.16,1,0.3,1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: var(--night);
    min-height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: radial-gradient(ellipse at 30% 20%, #131830, var(--night));
    color: var(--text);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
}

/* Particle Canvas */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.45;
    background: radial-gradient(ellipse at 30% 20%, #131830, var(--night));
}

/* Grain overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Container */
.tariff-container {
    position: relative;
    z-index: 10;
    max-width: 1280px;
    width: 90%;
    margin: 0 auto;
    padding: 40px 20px;
    padding-top: max(40px, env(safe-area-inset-top));
}

/* Header */
.tariff-header {
    text-align: center;
    margin-bottom: 64px;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Syne', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 32px;
    background: linear-gradient(135deg, #fff 20%, var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-dot {
    width: 12px;
    height: 12px;
    background: var(--primary-light);
    border-radius: 50%;
    box-shadow: 0 0 16px var(--primary-light);
    animation: breathe 2.5s ease-in-out infinite;
}

@keyframes breathe {
    0%,100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.tariff-header h1 {
    font-family: 'DM Serif Display', serif;
    font-size: 3rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 30%, var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

.tariff-header p {
    font-size: 1rem;
    color: var(--text-2);
    font-weight: 300;
}

/* Tariff Grid */
.tariff-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-top: 40px;
}

/* Tariff Card */
.tariff-card {
    background: var(--card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 40px 32px;
    position: relative;
    transition: all 0.3s var(--expo);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.tariff-card:hover {
    transform: translateY(-8px);
    border-color: rgba(155,135,245,0.4);
    box-shadow: 0 28px 50px -20px rgba(155,135,245,0.3);
}

.tariff-card.selected {
    border: 2px solid var(--primary);
    background: rgba(155,135,245,0.12);
    transform: scale(1.02);
}

.tariff-card.popular {
    border: 1px solid rgba(155,135,245,0.5);
    background: rgba(20,26,52,0.8);
    box-shadow: 0 0 0 1px rgba(155,135,245,0.12) inset, 0 40px 80px rgba(0,0,0,0.45);
    transform: scale(1.04);
    overflow: visible;
}

.tariff-card.popular:hover {
    transform: scale(1.04) translateY(-8px);
}

.popular-tag {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), var(--rose));
    color: #fff;
    font-family: 'Syne', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 5px 18px;
    border-radius: var(--r-pill);
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(155,135,245,0.5);
    z-index: 10;
}

.tariff-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(155,135,245,0.15);
    border: 1px solid var(--border);
    color: var(--primary-light);
    font-family: 'Syne', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--r-pill);
}

.tariff-card h2 {
    font-family: 'Syne', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
}

.tariff-price {
    font-family: 'Syne', sans-serif;
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--primary-light);
    margin-bottom: 28px;
    line-height: 1;
}

.tariff-price span {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-3);
}

.tariff-features {
    list-style: none;
    margin-bottom: 32px;
    flex-grow: 1;
}

.tariff-features li {
    font-size: 0.85rem;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    font-weight: 300;
}

.tariff-features i {
    font-size: 0.75rem;
    width: 20px;
    height: 20px;
    background: rgba(103,232,200,0.12);
    border: 1px solid rgba(103,232,200,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--aurora);
}

.tariff-features li.disabled {
    color: var(--text-3);
    opacity: 0.6;
}

.tariff-features li.disabled i {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--text-3);
}

/* Payment Button */
.payment-submit-btn {
    display: block;
    margin: 50px auto 0;
    padding: 16px 48px;
    font-family: 'Syne', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--rose));
    color: var(--inv);
    border: none;
    border-radius: var(--r-pill);
    cursor: pointer;
    transition: all 0.3s var(--expo);
    width: auto;
    min-width: 260px;
    box-shadow: 0 8px 28px rgba(155,135,245,0.4);
}

.payment-submit-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 14px 40px rgba(155,135,245,0.55);
}

.payment-submit-btn i {
    margin-right: 8px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(20px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border2);
    border-radius: var(--r-xl);
    padding: 48px;
    max-width: 450px;
    width: 90%;
    text-align: center;
}

.modal-content h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.8rem;
    font-weight: 400;
    background: linear-gradient(135deg, #fff 30%, var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

.modal-content p {
    color: var(--text-2);
    margin: 15px 0;
    font-size: 1rem;
}

.modal-content .payment-note {
    color: var(--gold);
    font-size: 0.85rem;
    background: rgba(245,200,66,0.1);
    padding: 12px;
    border-radius: var(--r-md);
}

.payment-btn {
    background: linear-gradient(135deg, var(--primary-light), var(--rose));
    border: none;
    border-radius: var(--r-pill);
    padding: 14px 40px;
    color: var(--inv);
    font-family: 'Syne', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s var(--expo);
    margin-top: 24px;
    width: 100%;
}

.payment-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 28px rgba(155,135,245,0.45);
}

.close-modal {
    float: right;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--primary-light);
    transition: all 0.3s;
    line-height: 1;
}

.close-modal:hover {
    color: var(--text);
    transform: rotate(90deg);
}

/* Responsive */
@media (max-width: 1000px) {
    .tariff-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .tariff-card.popular {
        transform: scale(1);
    }
    
    .tariff-card.popular:hover {
        transform: translateY(-8px);
    }
    
    .tariff-header h1 {
        font-size: 2.2rem;
    }
    
    .tariff-container {
        padding: 20px 15px;
    }
    
    .tariff-card {
        padding: 32px 28px;
    }
    
    .payment-submit-btn {
        width: 100%;
        max-width: 320px;
        padding: 14px 24px;
    }
}

@media (max-width: 600px) {
    .tariff-header h1 {
        font-size: 1.8rem;
    }
    
    .tariff-header p {
        font-size: 0.9rem;
    }
    
    .tariff-price {
        font-size: 2.2rem;
    }
    
    .tariff-card h2 {
        font-size: 1.3rem;
    }
    
    .tariff-features li {
        font-size: 0.78rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 32px 24px;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
    }
}