/* ========================================
   PERSONAL ACCOUNT - BASE STYLES
   ======================================== */

/* Glass card overrides for account/manage/referral pages */
.sub-step,
.sub-info-card,
.device-item,
.btn-expand,
.tariff-card-mini,
.ref-step,
.manage-block,
.account-stat-card,
.promo-input-row,
.referral-info-block {
    background: rgba(26, 26, 26, 0.65) !important;
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
}
.sub-step:hover,
.sub-info-card:hover,
.device-item:hover,
.btn-expand:hover {
    background: rgba(36, 36, 36, 0.75) !important;
}
[data-theme="light"] .sub-step,
[data-theme="light"] .sub-info-card,
[data-theme="light"] .device-item,
[data-theme="light"] .btn-expand,
[data-theme="light"] .tariff-card-mini,
[data-theme="light"] .ref-step,
[data-theme="light"] .manage-block,
[data-theme="light"] .account-stat-card,
[data-theme="light"] .promo-input-row,
[data-theme="light"] .referral-info-block {
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
}
[data-theme="light"] .sub-step:hover,
[data-theme="light"] .sub-info-card:hover,
[data-theme="light"] .device-item:hover,
[data-theme="light"] .btn-expand:hover {
    background: rgba(255, 255, 255, 0.7) !important;
}

/* ========================================
   DEVICE MANAGEMENT
   ======================================== */

.devices-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.device-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.device-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.device-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.device-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-white);
}

.device-details {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.device-details span {
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.device-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-delete-device {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    color: #f87171;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-device:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    transform: scale(1.05);
}

.btn-delete-device svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {
    .device-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.875rem;
    }
    
    .device-info {
        width: 100%;
    }
    
    .btn-delete-device {
        align-self: flex-end;
        width: 36px;
        height: 36px;
    }
    
    .device-details {
        gap: 0.5rem;
        font-size: 0.8rem;
    }
}

/* Compact device items (manage page) */
.device-item-compact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}
.device-item-compact:last-child { margin-bottom: 0; }
.device-item-compact:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}
.device-compact-info {
    flex: 1;
    min-width: 0;
}
.device-compact-line1 {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.device-compact-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-white);
}
.device-compact-details {
    font-size: 0.75rem;
    color: var(--text-dim);
}
.device-compact-meta {
    font-size: 0.75rem;
    color: var(--text-hint);
    margin-top: 0.15rem;
}
.device-item-compact .btn-delete-device {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}
.device-item-compact .btn-delete-device svg {
    width: 14px;
    height: 14px;
}

/* QR Modal */
.qr-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.qr-modal {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.5rem;
    max-width: 340px;
    width: 100%;
}
.qr-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.qr-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-white);
}
.qr-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 4px;
}
.qr-modal-close:hover { color: var(--color-white); }
.qr-modal-body {
    text-align: center;
}
.qr-modal-body canvas {
    width: 100%;
    max-width: 256px;
    height: auto;
    border-radius: 12px;
    background: #fff;
    padding: 8px;
}
.qr-modal-hint {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

:root {
    --header-height: 60px;
    --transition-speed: 0.3s;
}

body {
    background: var(--bg-body);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   TOP MENU
   ======================================== */
.account-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.25rem;
    z-index: 100;
}

.header-title {
    position: absolute;
    left: 1.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-orange), var(--color-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    flex-shrink: 0;
}

.header-logo-link {
    position: absolute;
    left: 1.25rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(var(--color-orange-rgb), 0.4)) drop-shadow(0 0 20px rgba(var(--color-orange-rgb), 0.2));
    transition: filter 0.3s, transform 0.3s;
}

.header-logo-img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 14px rgba(var(--color-orange-rgb), 0.6)) drop-shadow(0 0 28px rgba(var(--color-orange-rgb), 0.3));
}

.header-spacer {
    display: none;
}

.btn-header-logout {
    position: absolute;
    right: 1.25rem;
}

/* Mobile: center title/logo */
@media (max-width: 768px) {
    .header-title {
        left: 50%;
        transform: translateX(-50%);
    }
    .header-logo-link {
        left: 50%;
        transform: translateX(-50%);
    }
    .btn-header-logout {
        right: 1rem;
    }
}

/* =============================================
   Navigation Bar (Desktop: top, Mobile: bottom floating)
   ============================================= */

/* Desktop: horizontal bar centered in header */
.account-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
}
[data-theme="light"] .nav-item:hover {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.8);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(var(--color-orange-rgb), 0.15), rgba(var(--color-gold-rgb), 0.08));
    color: var(--color-orange);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    /* Paint the icon shape (from --nav-icon URL on the span) in a single
       flat colour via mask. Background colour is the paint — it follows the
       brand primary var automatically on active state, and adapts to the
       theme's muted colour on inactive. No hardcoded filter hacks. */
    mask-image: var(--nav-icon);
    -webkit-mask-image: var(--nav-icon);
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
    mask-size: contain;
    -webkit-mask-size: contain;
    background-color: rgba(255, 255, 255, 0.55);
    transition: background-color 0.2s;
}
[data-theme="light"] .nav-icon {
    background-color: rgba(0, 0, 0, 0.55);
}
.nav-item:hover .nav-icon {
    background-color: rgba(255, 255, 255, 0.9);
}
[data-theme="light"] .nav-item:hover .nav-icon {
    background-color: rgba(0, 0, 0, 0.8);
}
.nav-item.active .nav-icon {
    background-color: var(--color-orange);
}

.nav-icon-emoji {
    width: auto;
    height: auto;
    filter: none !important;
    font-size: 1.15rem;
    opacity: 1;
    line-height: 1;
}

.nav-label {
    font-size: inherit;
}

/* Logout button in header */
.btn-header-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: var(--bg-btn);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.btn-header-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Header hamburger menu */
.header-menu-wrap {
    position: absolute;
    right: 1.25rem;
    flex-shrink: 0;
}

.btn-header-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: var(--bg-btn);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-header-menu span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-muted);
    border-radius: 1px;
    transition: background 0.2s;
}

.btn-header-menu:hover {
    background: var(--bg-btn-hover);
    border-color: var(--border-hover);
}

.btn-header-menu:hover span {
    background: var(--color-orange);
}

.header-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--bg-header);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0.4rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 200;
}

.header-dropdown.open {
    display: block;
}

.header-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
}

.header-dropdown-item:hover {
    background: var(--bg-btn-hover);
}

.header-dropdown-item img {
    width: 16px;
    height: 16px;
    filter: var(--icon-filter);
    opacity: var(--icon-opacity);
}

.header-dropdown-item svg {
    flex-shrink: 0;
}

.header-dropdown-logout:hover {
    color: #f87171;
}

.theme-label-light { display: none; }
.theme-label-dark { display: inline; }
[data-theme="light"] .theme-label-light { display: inline; }
[data-theme="light"] .theme-label-dark { display: none; }

/* Mobile bottom nav wrapper */
.nav-mobile-wrapper {
    display: none;
    position: relative;
    z-index: 100;
}

/* Hide desktop nav container on mobile, show mobile wrapper */
@media (max-width: 768px) {
    .header-nav-desktop {
        display: none !important;
    }

    .nav-mobile-wrapper {
        display: block;
    }

    .nav-mobile-wrapper .account-nav {
        position: fixed;
        bottom: 0.75rem;
        left: 0.75rem;
        right: 0.75rem;
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 0.6rem 0.25rem;
        background: var(--bg-header);
        backdrop-filter: blur(40px) saturate(180%);
        -webkit-backdrop-filter: blur(40px) saturate(180%);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 22px;
        box-shadow:
            0 12px 40px rgba(0, 0, 0, 0.6),
            0 0 0 0.5px rgba(255, 255, 255, 0.06),
            inset 0 1px 0 rgba(255, 255, 255, 0.08);
        z-index: 100;
        margin: 0;
        gap: 0;
    }

    .nav-mobile-wrapper .nav-item {
        flex-direction: column;
        gap: 0.2rem;
        padding: 0.4rem 0.75rem;
        font-size: 0.7rem;
        border-radius: 12px;
        flex: 1;
        justify-content: center;
    }

    .nav-mobile-wrapper .nav-icon {
        width: 22px;
        height: 22px;
    }

    .nav-mobile-wrapper .nav-icon-emoji {
        font-size: 1.3rem;
    }

    .nav-mobile-wrapper .nav-label {
        font-size: 0.65rem;
        font-weight: 500;
    }

    .nav-mobile-wrapper .nav-item.active {
        background: rgba(var(--color-orange-rgb), 0.12);
    }

    /* Padding for main content so bottom bar doesn't overlap */
    .main-content {
        padding-bottom: 5.5rem !important;
    }
}

/* Chart empty state (traffer / partner page) */
.chart-wrapper-with-empty {
    position: relative;
    min-height: 200px;
}
.chart-empty-state {
    display: none;
    position: absolute;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
}
.chart-empty-state.visible {
    display: flex;
}
.chart-empty-state .chart-empty-icon {
    width: 56px;
    height: 56px;
    opacity: 0.7;
    object-fit: contain;
    filter: var(--icon-filter);
}
.chart-empty-bar.chart-empty-state.visible ~ canvas {
    visibility: hidden;
    pointer-events: none;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    position: relative;
    z-index: 1;
    padding: calc(var(--header-height) + 2rem) 1.5rem 2rem;
    min-height: 100vh;
}

.page-content {
    max-width: 900px;
    margin: 0 auto;
}

/* Loading */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(var(--color-orange-rgb), 0.2);
    border-top-color: var(--color-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    color: var(--text-muted);
}

/* ========================================
   OVERVIEW PAGE - NO SUBSCRIPTION
   ======================================== */
.no-subscription {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.overview-title {
    text-align: center;
    margin-bottom: 0.5rem;
}

.overview-title h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 0.5rem;
}

.overview-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    text-align: center;
    margin-bottom: 2.5rem;
}

/* ========================================
   CONNECTION STEPS
   ======================================== */
.steps-container {
    position: relative;
}

.step {
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(var(--color-orange-rgb), 0.2);
    border-radius: 20px;
    padding: 1.75rem;
    margin-bottom: 0;
    position: relative;
    transition: all var(--transition-speed) ease;
}

.step:hover {
    border-color: rgba(var(--color-orange-rgb), 0.4);
    box-shadow: 0 4px 20px rgba(var(--color-orange-rgb), 0.1);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-orange), var(--color-gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--color-black);
    font-size: 1rem;
    flex-shrink: 0;
}

.step-number.step-number-icon {
    padding: 0;
    background: rgba(255, 255, 255, 0.12);
}
.step-number.step-number-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.step-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-white);
}

.step-content {
    padding-left: 52px;
}

/* Animated dashed line between steps */
.step-connector {
    width: 2px;
    height: 40px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.step-connector::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%;
    background: repeating-linear-gradient(
        to bottom,
        var(--color-orange) 0,
        var(--color-orange) 8px,
        transparent 8px,
        transparent 16px
    );
    animation: dashMove 2s linear infinite;
    will-change: transform;
}

@keyframes dashMove {
    0% { transform: translateY(-50%); }
    100% { transform: translateY(0); }
}

/* ========================================
   STEP 1: PLAN SELECTION
   ======================================== */
.btn-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    background: var(--bg-btn);
    border: 1px solid var(--border-btn);
    border-radius: 12px;
    color: var(--color-white);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-expand:hover {
    background: var(--bg-btn-hover);
    border-color: var(--border-btn-hover);
    color: var(--color-orange);
}

.btn-expand svg {
    transition: transform var(--transition-speed) ease;
}

.btn-expand.expanded svg {
    transform: rotate(45deg);
}

/* Tariffs container */
.tariffs-expand {
    display: none;
    margin-top: 1.5rem;
    animation: slideDown 0.3s ease;
}

.tariffs-expand.show {
    display: block;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tariff carousel for mobile and desktop (when tariffs > 2) */
.tariffs-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--color-orange-rgb), 0.3) transparent;
}

.tariffs-carousel::-webkit-scrollbar {
    height: 8px;
}

.tariffs-carousel::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

.tariffs-carousel::-webkit-scrollbar-thumb {
    background: rgba(var(--color-orange-rgb), 0.3);
    border-radius: 4px;
}

.tariffs-carousel::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--color-orange-rgb), 0.5);
}

/* Tariff grid for desktop (when tariffs <= 2) */
.tariffs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 0.5rem 0;
}

/* Mouse wheel scrolling for desktop */
@media (min-width: 769px) {
    .tariffs-carousel {
        cursor: grab;
    }
    
    .tariffs-carousel:active {
        cursor: grabbing;
    }
    
    .tariffs-carousel {
        scrollbar-width: thin;
    }
}

.tariff-card-mini {
    flex: 0 0 280px;
    scroll-snap-align: center;
    background: rgba(42, 42, 42, 0.8);
    border: 1px solid rgba(var(--color-orange-rgb), 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all var(--transition-speed) ease;
}

/* In grid, cards take available space */
.tariffs-grid .tariff-card-mini {
    flex: 1 1 auto;
    min-width: 280px;
}

.tariff-card-mini:hover {
    border-color: var(--color-orange);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(var(--color-orange-rgb), 0.2);
}

.tariff-card-mini.selected {
    border-color: var(--color-gold);
    background: rgba(var(--color-orange-rgb), 0.1);
}

.tariff-mini-header {
    margin-bottom: 1rem;
}

.tariff-mini-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-white);
    margin-bottom: 0.5rem;
}

.tariff-mini-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-orange);
}

.tariff-mini-price span {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
}

.tariff-mini-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem 0;
}

.tariff-mini-features li {
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0.35rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tariff-mini-features li::before {
    content: '✓';
    color: var(--color-gold);
    font-weight: 600;
}

.btn-select-tariff {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--color-orange), var(--color-gold));
    border: none;
    border-radius: 10px;
    color: var(--color-black);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.btn-select-tariff:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(var(--color-orange-rgb), 0.4);
}

/* Selected tariff */
.selected-tariff-info {
    display: none;
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: rgba(var(--color-orange-rgb), 0.1);
    border: 1px solid rgba(var(--color-orange-rgb), 0.3);
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
}

.selected-tariff-info.show {
    display: block;
}

.selected-tariff-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.selected-tariff-name {
    font-weight: 600;
    color: var(--color-white);
}

.selected-tariff-price {
    font-weight: 700;
    color: var(--color-orange);
}

.btn-change-tariff {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    transition: all var(--transition-speed) ease;
}

.btn-change-tariff:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--color-white);
}

.btn-pay {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--color-orange), var(--color-gold));
    border: none;
    border-radius: 12px;
    color: var(--color-black);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 20px rgba(var(--color-orange-rgb), 0.3);
}

.btn-pay:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(var(--color-orange-rgb), 0.5);
}

/* ========================================
   STEP 2: TELEGRAM
   ======================================== */
.btn-telegram-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(42, 171, 238, 0.2), rgba(42, 171, 238, 0.1));
    border: 1px solid rgba(42, 171, 238, 0.4);
    border-radius: 12px;
    color: #2aabee;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.btn-telegram-link:hover {
    background: linear-gradient(135deg, rgba(42, 171, 238, 0.3), rgba(42, 171, 238, 0.2));
    border-color: rgba(42, 171, 238, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(42, 171, 238, 0.3);
}

.btn-telegram-link img {
    width: 24px;
    height: 24px;
}

/* ========================================
   STEP 3: REFERRAL LINK
   ======================================== */
.referral-box {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1rem;
}

.referral-link-display {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.referral-input {
    flex: 1;
    min-width: 200px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    color: var(--color-orange);
    font-family: monospace;
    font-size: 0.85rem;
}

.btn-copy-ref {
    padding: 0.875rem 1.5rem;
    background: var(--bg-btn);
    border: 1px solid var(--border-btn);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-copy-ref:hover {
    background: var(--bg-btn-hover);
    border-color: var(--border-btn-hover);
    color: var(--color-orange);
}

.referral-bonus {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.referral-bonus span {
    color: var(--color-gold);
    font-weight: 600;
}

/* ========================================
   MODAL WINDOW
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: rgba(30, 30, 30, 0.98);
    border: 1px solid rgba(var(--color-orange-rgb), 0.3);
    border-radius: 20px;
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    font-size: 1.25rem;
    color: var(--color-white);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0.25rem;
    transition: color var(--transition-speed) ease;
}

.modal-close:hover {
    color: var(--color-orange);
}

.modal-body {
    padding: 1.5rem;
}

/* Payment methods */
.payment-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(42, 42, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    margin-bottom: 0.75rem;
}

.payment-method:hover {
    border-color: rgba(var(--color-orange-rgb), 0.5);
    background: rgba(var(--color-orange-rgb), 0.1);
}

.payment-method.selected {
    border-color: var(--color-orange);
    background: rgba(var(--color-orange-rgb), 0.15);
}

.payment-method-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 2px;
}

.payment-method-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 6px;
}

.payment-method-icon:not(:has(img)) {
    font-size: 24px;
}

.payment-method-name {
    flex: 1;
    font-weight: 500;
    color: var(--color-white);
}

/* Form for traffer */
.form-group {
    margin-bottom: 1.25rem;
}

/* Only labels above fields (direct child), not nested labels (e.g. payment method options in traffer modal) */
.form-group > label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 0.875rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--color-white);
    font-size: 1rem;
    transition: all var(--transition-speed) ease;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--color-orange);
    background: rgba(20, 20, 20, 0.9);
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--color-orange), var(--color-gold));
    border: none;
    border-radius: 12px;
    color: var(--color-black);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 20px rgba(var(--color-orange-rgb), 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(var(--color-orange-rgb), 0.5);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========================================
   OVERVIEW PAGE - ACTIVE SUBSCRIPTION
   ======================================== */
.active-subscription {
    animation: fadeIn 0.5s ease;
}

.subscription-steps {
    position: relative;
}

.sub-step {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 1.75rem;
    position: relative;
    transition: all var(--transition-speed) ease;
}

.sub-step:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 20px rgba(var(--color-orange-rgb), 0.1);
}

.sub-step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sub-step-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--color-orange), var(--color-gold));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    color: var(--color-black);
}

.sub-step-icon svg,
.sub-step-icon img.icon-question,
.sub-step-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: brightness(0);
}
.sub-step-icon svg {
    stroke: var(--color-black);
    stroke-width: 2.5;
}
.icon-question-black {
    filter: brightness(0);
}
.step-number-icon img.icon-question {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.sub-step-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sub-step-content {
    padding-left: 0;
}

/* ========================================
   ACTIVE SUB: ACTION BUTTONS & PANELS
   ======================================== */
.sub-actions {
    margin-top: 1.25rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}


@media (max-width: 780px) {
    .sub-actions {
        grid-template-columns: 1fr;
    }
}

.sub-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    cursor: pointer;
    border: 1px solid var(--border-subtle);
    background: var(--bg-btn);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    user-select: none;
    min-height: 48px;
    text-align: center;
    word-wrap: break-word;
}

.sub-action-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--color-orange-rgb), 0.28);
    background: rgba(var(--color-orange-rgb), 0.08);
    box-shadow: 0 4px 12px rgba(var(--color-orange-rgb), 0.15);
}

.sub-action-btn:active {
    transform: translateY(0);
}

.sub-action-ico {
    opacity: 0.9;
}

.sub-action-icon {
    width: 18px;
    height: 18px;
    opacity: var(--icon-opacity);
    filter: var(--icon-filter);
    flex-shrink: 0;
}

.sub-dynamic-panels {
    display: block;
    margin: 0;
}

.sub-dynamic-panels:empty {
    display: none;
}

.sub-actions-secondary {
    margin-top: 0.75rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.sub-action-btn-secondary {
    background: rgba(0, 0, 0, 0.18);
}

.sub-action-btn-tertiary {
    margin-top: 0.75rem;
    width: 100%;
    background: rgba(var(--color-gold-rgb), 0.08);
    border-color: rgba(var(--color-gold-rgb), 0.18);
}

@media (max-width: 780px) {
    .sub-actions-secondary {
        grid-template-columns: 1fr;
    }
}

.sub-action-header {
    position: relative;
}

.sub-panel-close {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
    color: rgba(255, 255, 255, 0.7);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sub-panel-close:hover {
    background: rgba(255, 107, 107, 0.12);
    border-color: rgba(255, 107, 107, 0.25);
    color: rgba(255, 255, 255, 0.9);
}

.sub-panel-body {
    padding-top: 0.25rem;
}

.sub-panel-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.sub-panel-linkrow {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.sub-panel-input {
    flex: 1;
    min-width: 220px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0.85rem 0.9rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    box-sizing: border-box;
}

.sub-panel-actions {
    margin-top: 0.85rem;
}

.sub-panel-tariffs {
    margin-top: 0.75rem;
}

.sub-panel-payrow {
    margin-top: 0.75rem;
}

.sub-panel-status {
    margin-top: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.sub-pay-success {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.22);
    color: rgba(255, 255, 255, 0.92);
    font-weight: 800;
    animation: popIn 0.35s ease;
}

@keyframes popIn {
    from { transform: scale(0.96); opacity: 0.2; }
    to { transform: scale(1); opacity: 1; }
}

.inline-pay-block {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.payment-actions {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Payment waiting animation */
.payment-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    gap: 1rem;
}

.payment-waiting-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(var(--color-orange-rgb), 0.2);
    border-top-color: var(--color-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.payment-waiting-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
}

/* Successful payment animation */
.payment-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    gap: 1rem;
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.payment-success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.1));
    border: 3px solid rgba(16, 185, 129, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
    animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

.payment-success-icon svg {
    width: 48px;
    height: 48px;
    stroke-width: 3;
}

.payment-success-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #10b981;
    text-align: center;
}

.payment-success-timer {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.payment-success-timer span {
    color: var(--color-orange);
    font-weight: 600;
    font-size: 1.2rem;
}

.payment-actions.show {
    display: flex;
}

.btn-change-payment-method {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.btn-change-payment-method:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--color-white);
}

@media (max-width: 768px) {
    .payment-actions {
        gap: 0.5rem;
    }
    
    .btn-change-payment-method {
        padding: 0.625rem;
        font-size: 0.85rem;
    }
}

.inline-pay-title {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 700;
    margin-bottom: 0.6rem;
}

/* Info grid */
.sub-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 1.25rem;
}

@media (max-width: 768px) {
    .sub-info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.sub-info-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1rem;
    transition: all var(--transition-speed) ease;
    min-width: 0; /* prevent content from stretching the grid cell */
}

.sub-info-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.sub-info-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.sub-info-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-white);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.sub-info-value.warning {
    color: #ff9800;
}

.sub-info-value.success {
    color: #4caf50;
}

/* Container for value with action button */
.sub-info-value-with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: nowrap;
    min-width: 0;
}

/* Value doesn't overlap the button */
.sub-info-value-with-action .sub-info-value {
    flex: 1 1 auto;
    min-width: 0;
}

/* In "Referrals invited" block the number doesn't take space from the button; button can shrink and doesn't overflow right */
.sub-info-value-with-action:has(#btn-invite-bonus) {
    min-width: 0;
}
.sub-info-value-with-action:has(#btn-invite-bonus) .sub-info-value {
    flex: 0 0 auto;
}

/* Action button next to value */
.btn-inline-action {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    background: rgba(var(--color-orange-rgb), 0.15);
    border: 1px solid rgba(var(--color-orange-rgb), 0.4);
    border-radius: 10px;
    color: var(--color-orange);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-inline-action:hover {
    background: rgba(var(--color-orange-rgb), 0.25);
    border-color: rgba(var(--color-orange-rgb), 0.6);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--color-orange-rgb), 0.2);
}

.btn-inline-action:active {
    transform: translateY(0);
}

.btn-inline-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* "Invite and get bonus" button — doesn't overflow; increased padding so text isn't pressed against edges */
#btn-invite-bonus,
.btn-invite-bonus {
    font-size: clamp(0.72rem, 1.4vw, 0.8125rem);
    padding: 0.5rem 1.25rem;
    min-height: 32px;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

/* Inner button text — small right padding so "bonus" isn't pressed against the edge */
.btn-invite-bonus .btn-invite-bonus-text {
    display: inline-block;
    padding-right: 0.15em;
}

/* Full text by default, short text hidden */
.btn-invite-bonus .btn-invite-bonus-text-short {
    display: none;
}
.btn-invite-bonus .btn-invite-bonus-text-full {
    display: inline;
}

/* On screens up to 768px — only "Invite" so the button doesn't overflow right (tablet, phone) */
@media (max-width: 768px) {
    .btn-invite-bonus .btn-invite-bonus-text-full {
        display: none;
    }
    .btn-invite-bonus .btn-invite-bonus-text-short {
        display: inline;
    }
}

/* Small caption under "Subscription stats": user ID with copy button */
.sub-step-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.sub-step-expires {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Compact info cards */
.sub-info-grid-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.sub-info-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: all var(--transition-speed) ease;
    min-width: 0;
}

.sub-info-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.sub-info-card-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    opacity: var(--icon-opacity);
    filter: var(--icon-filter);
}

.sub-info-card-body {
    flex: 1;
    min-width: 0;
}

.sub-info-card-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.sub-info-card-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sub-info-card-value code {
    font-family: ui-monospace, monospace;
    font-size: 0.85rem;
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

.sub-info-card-value.success {
    color: #4caf50;
}

.sub-info-card-action {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-btn);
    border: 1px solid var(--border-btn);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.sub-info-card-action:hover {
    background: var(--bg-btn-hover);
    border-color: var(--border-btn-hover);
    color: var(--color-orange);
}

.sub-info-card-action img {
    opacity: var(--icon-opacity);
    filter: var(--icon-filter);
    transition: opacity 0.2s;
}

.sub-info-card-action:hover img {
    opacity: 0.85;
}
.sub-step-caption.sub-step-user-id-caption {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}
.sub-step-user-id-value {
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    background: none;
    border: none;
    padding: 0;
}
.btn-copy-id-inline {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease;
}
.btn-copy-id-inline:hover {
    color: var(--color-orange);
    background: rgba(var(--color-orange-rgb), 0.15);
}
.btn-copy-id-inline.copied {
    color: #4caf50;
}

.btn-telegram-link-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, rgba(42, 171, 238, 0.22), rgba(42, 171, 238, 0.12));
    border: 1px solid rgba(42, 171, 238, 0.45);
    border-radius: 10px;
    color: #2aabee;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    line-height: 1;
}

.btn-telegram-link-inline:hover {
    background: linear-gradient(135deg, rgba(42, 171, 238, 0.3), rgba(42, 171, 238, 0.2));
    border-color: rgba(42, 171, 238, 0.65);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(42, 171, 238, 0.25);
}

.btn-telegram-link-inline img {
    width: 20px;
    height: 20px;
}

/* Telegram linking waiting state (spinner + text instead of button) */
.telegram-link-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.telegram-link-waiting-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.3;
}

.btn-telegram-link.telegram-link-state-waiting,
.btn-telegram-link-inline.telegram-link-state-waiting {
    pointer-events: none;
    cursor: default;
    min-height: 100px;
}

.btn-telegram-link.telegram-link-state-waiting .payment-waiting-spinner,
.btn-telegram-link-inline.telegram-link-state-waiting .payment-waiting-spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

/* Connection block */
.connection-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(var(--color-orange-rgb), 0.05);
    border: 1px dashed rgba(var(--color-orange-rgb), 0.3);
    border-radius: 12px;
}

.btn-connect {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--bg-btn);
    border: 1px solid var(--border-btn);
    border-radius: 12px;
    color: var(--color-white);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-connect:hover {
    background: var(--bg-btn-hover);
    border-color: var(--border-btn-hover);
    color: var(--color-orange);
}

.btn-connect:active {
    transform: scale(0.98);
}

.btn-connect svg,
.btn-connect-icon {
    transition: transform 0.2s ease;
}

.btn-connect-icon {
    width: 18px;
    height: 18px;
    filter: var(--icon-filter);
    opacity: var(--icon-opacity);
}

.btn-connect:hover .btn-connect-icon {
    opacity: 0.9;
}

.btn-expand .btn-connect-icon {
    width: 16px;
    height: 16px;
    filter: var(--icon-filter);
    opacity: var(--icon-opacity);
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   RESPONSIVENESS - PC
   ======================================== */
@media (min-width: 769px) {
    /* Carousel on desktop should remain flex with horizontal scroll */
    .tariffs-carousel {
        display: flex;
        overflow-x: auto;
        overflow-y: visible;
    }
    
    /* Grid for desktop when tariffs <= 2 */
    .tariffs-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 1.25rem;
        overflow: visible;
    }

    .tariff-card-mini {
        flex: none;
    }
}

/* ========================================
   RESPONSIVENESS - TABLETS
   ======================================== */
@media (max-width: 1024px) and (min-width: 769px) {
    .sub-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   RESPONSIVENESS - MOBILE
   ======================================== */
@media (max-width: 768px) {
    .main-content {
        padding: calc(var(--header-height) + 1.5rem) 1rem 1.5rem;
    }

    .step {
        padding: 1.25rem;
    }

    .step-content {
        padding-left: 0;
        margin-top: 1rem;
    }

    .tariff-card-mini {
        flex: 0 0 260px;
    }

    .overview-title h2 {
        font-size: 1.4rem;
    }

    .step-title {
        font-size: 1rem;
    }

    .btn-expand {
        padding: 0.875rem;
        font-size: 0.9rem;
    }

    /* Referral link - button below */
    .referral-link-display {
        flex-direction: column;
    }

    .referral-input {
        width: 100%;
        font-size: 0.8rem;
    }

    .btn-copy-ref {
        width: 100%;
        text-align: center;
    }

    /* Active subscription adaptation */
    .sub-step {
        padding: 1.25rem;
    }

    .sub-step-header {
        margin-bottom: 1.25rem;
    }

    .sub-step-icon {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }

    .sub-step-title {
        font-size: 1.1rem;
    }

    .sub-info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .sub-info-item {
        padding: 0.875rem;
    }

    .sub-info-value {
        font-size: 1.1rem;
    }

    /* "Subscription expires" / "Connected devices" values — in one line */
    .sub-info-item .sub-info-value-with-action .sub-info-value {
        font-size: clamp(0.875rem, 2.5vw, 1.1rem);
    }

    .connection-hint {
        font-size: 0.875rem;
        padding: 0.875rem;
    }

    .btn-connect {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 1.25rem;
    }

    .tariff-card-mini {
        flex: 0 0 240px;
        padding: 1.25rem;
    }

    .tariff-mini-price {
        font-size: 1.3rem;
    }

    /* Active subscription on small screens */
    .sub-step {
        padding: 1rem;
    }

    .sub-step-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .sub-step-title-wrap {
        flex: 1;
        min-width: 0;
    }

    .sub-step-expires {
        width: 100%;
        margin-left: 0;
        order: 3;
        padding-left: calc(36px + 0.5rem);
        margin-top: -0.15rem;
    }

    .sub-info-grid-compact {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .sub-step-icon {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .sub-step-title {
        font-size: 1rem;
    }

    .sub-info-grid {
        gap: 0.875rem;
    }

    .sub-info-label {
        font-size: 0.8rem;
    }

    .sub-info-value {
        font-size: 1rem;
    }

    /* "Subscription expires" and "Connected devices" text — in one line, don't stretch blocks */
    .sub-info-item .sub-info-value-with-action .sub-info-value {
        font-size: clamp(0.8rem, 2.8vw, 1rem);
    }
    
    .sub-action-btn {
        padding: 0.875rem 0.75rem;
        font-size: 0.875rem;
        min-height: 44px;
    }
    
    .sub-action-ico {
        font-size: 1.1rem;
    }
    
    /* For "Days remaining", "Connected devices", "Referrals invited" blocks — in one line with button */
    #btn-renew-inline,
    #btn-increase-limit,
    #btn-invite-bonus {
        flex: 0 0 auto;
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
        min-height: 32px;
        white-space: nowrap;
    }
    
    /* "Invite and get bonus" button — more compact on narrow screens to fit in one line */
    #btn-invite-bonus {
        font-size: clamp(0.65rem, 2.2vw, 0.8rem);
        padding: 0.35rem 0.6rem;
    }
    
    /* For containers with these buttons - horizontal layout */
    .sub-info-item .sub-info-value-with-action:has(#btn-renew-inline),
    .sub-info-item .sub-info-value-with-action:has(#btn-increase-limit),
    .sub-info-item .sub-info-value-with-action:has(#btn-invite-bonus) {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
    }
    
    .sub-info-item .sub-info-value-with-action:has(#btn-renew-inline) .sub-info-value,
    .sub-info-item .sub-info-value-with-action:has(#btn-increase-limit) .sub-info-value,
    .sub-info-item .sub-info-value-with-action:has(#btn-invite-bonus) .sub-info-value {
        flex: 0 0 auto;
        margin: 0;
        font-size: 1.1rem;
    }
    
    /* Fallback for browsers without :has() support - use nth-child */
    @supports not selector(:has(*)) {
        .sub-info-item:nth-child(1) .sub-info-value-with-action,
        .sub-info-item:nth-child(2) .sub-info-value-with-action,
        .sub-info-item:nth-child(3) .sub-info-value-with-action {
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
        }
        
        .sub-info-item:nth-child(1) .sub-info-value-with-action .sub-info-value,
        .sub-info-item:nth-child(2) .sub-info-value-with-action .sub-info-value,
        .sub-info-item:nth-child(3) .sub-info-value-with-action .sub-info-value {
            flex: 0 0 auto;
            margin: 0;
            font-size: 1.1rem;
        }
        
        .sub-info-item:nth-child(1) .btn-inline-action,
        .sub-info-item:nth-child(2) .btn-inline-action,
        .sub-info-item:nth-child(3) .btn-inline-action {
            flex: 0 0 auto;
            padding: 0.4rem 0.75rem;
            font-size: 0.8rem;
            min-height: 32px;
            white-space: nowrap;
        }
        
        .sub-info-item:nth-child(3) #btn-invite-bonus {
            font-size: clamp(0.65rem, 2.2vw, 0.8rem);
            padding: 0.35rem 0.6rem;
        }
    }
    
    /* For remaining blocks (Token, Telegram, Valid until) - vertical layout */
    .sub-info-item:nth-child(n+4) .sub-info-value-with-action {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .sub-info-item:nth-child(n+4) .sub-info-value-with-action .sub-info-value {
        width: 100%;
    }
    
    .sub-info-item:nth-child(n+4) .btn-inline-action {
        width: 100%;
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        min-height: 40px;
        justify-content: center;
    }
    
    .sub-info-item {
        padding: 1.25rem 1rem;
    }
    
    .sub-info-label {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }
    
    .sub-info-value {
        font-size: 1.1rem;
    }

    .connection-hint {
        font-size: 0.825rem;
    }
}

/* ========================================
   THREE ACTION BUTTONS IN ONE ROW
   ======================================== */
.sub-actions-three {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.sub-actions-four {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

@media (max-width: 780px) {
    .sub-actions-three,
    .sub-actions-four {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 400px) {
    .sub-actions-three,
    .sub-actions-four {
        grid-template-columns: 1fr !important;
    }
}

/* ========================================
   PURCHASE PANEL V2
   ======================================== */
.purchase-panel-v2 {
    padding: 1.5rem;
}

.pp2-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.pp2-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.pp2-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--color-orange), var(--color-gold));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pp2-icon .sub-step-icon-img {
    width: 24px;
    height: 24px;
    filter: brightness(0);
}

.pp2-header-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.pp2-title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.pp2-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-white);
}

.pp2-badge {
    padding: 0.3rem 0.65rem;
    background: linear-gradient(135deg, rgba(var(--color-orange-rgb), 0.18), rgba(var(--color-gold-rgb), 0.12));
    border: 1px solid rgba(var(--color-orange-rgb), 0.35);
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--color-orange);
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Device Slider Section */
.pp2-device-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.pp2-device-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.pp2-device-count {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    flex-shrink: 0;
}

.pp2-device-text {
    display: flex;
    flex-direction: column;
}

.pp2-device-text > span {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.pp2-device-subtitle {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.pp2-device-slider-wrap {
    padding: 0 0.25rem;
}

.pp2-device-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-btn);
    outline: none;
    cursor: pointer;
}

.pp2-device-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-orange), var(--color-gold));
    border: 2px solid rgba(0, 0, 0, 0.3);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(var(--color-orange-rgb), 0.4);
    transition: transform 0.15s ease;
}

.pp2-device-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.pp2-device-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-orange), var(--color-gold));
    border: 2px solid rgba(0, 0, 0, 0.3);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(var(--color-orange-rgb), 0.4);
}

.pp2-device-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    padding: 0 2px;
}

.pp2-device-labels span {
    font-size: 0.75rem;
    color: var(--text-hint);
    font-weight: 500;
    transition: color 0.2s;
}

.pp2-device-labels span.active {
    color: var(--color-orange);
    font-weight: 700;
}

/* Tariff Cards 2x2 Grid */
.pp2-tariffs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.pp2-tariff-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 1rem 1.15rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pp2-tariff-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.pp2-tariff-card.selected {
    border-color: var(--color-orange);
    background: rgba(var(--color-orange-rgb), 0.12);
    box-shadow: 0 0 0 1px var(--color-orange);
}

.pp2-tariff-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.pp2-tariff-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.pp2-tariff-permonth {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 0.2rem;
}

/* Promo Code Row */
.pp2-promo-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    position: relative;
}

.pp2-promo-input-wrap {
    flex: 1;
    position: relative;
}

.pp2-promo-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    opacity: 0.35;
    filter: var(--icon-filter, brightness(0) invert(1));
    transition: all 0.2s;
    pointer-events: none;
    z-index: 1;
}

.pp2-promo-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.pp2-promo-input::placeholder {
    color: var(--text-hint);
}

.pp2-promo-input:focus {
    border-color: rgba(var(--color-orange-rgb), 0.5);
}

.pp2-promo-btn {
    padding: 0.8rem 1.25rem;
    background: var(--bg-btn);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: default;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.pp2-promo-btn:not(:disabled) {
    background: rgba(var(--color-orange-rgb), 0.15);
    border-color: rgba(var(--color-orange-rgb), 0.35);
    color: var(--color-orange);
    cursor: pointer;
}

.pp2-promo-btn:not(:disabled):hover {
    background: rgba(var(--color-orange-rgb), 0.25);
    border-color: rgba(var(--color-orange-rgb), 0.55);
}

.pp2-promo-btn:disabled {
    opacity: 1;
    cursor: default;
}

/* Promo success state */
.pp2-promo-success .pp2-promo-icon {
    filter: brightness(0) invert(0.55) sepia(1) saturate(5) hue-rotate(85deg);
    opacity: 1;
}
.pp2-promo-success .pp2-promo-input {
    border-color: rgba(76, 175, 80, 0.5);
    color: #4caf50;
}
.pp2-promo-success .pp2-promo-btn {
    background: rgba(76, 175, 80, 0.15) !important;
    border-color: rgba(76, 175, 80, 0.4) !important;
    color: #4caf50 !important;
    cursor: default !important;
}

/* Promo error state */
.pp2-promo-error .pp2-promo-icon {
    filter: brightness(0) invert(0.4) sepia(1) saturate(10) hue-rotate(0deg);
    opacity: 1;
}
.pp2-promo-error .pp2-promo-input {
    border-color: rgba(244, 67, 54, 0.5);
    color: #f44336;
}

/* Promo message */
.pp2-promo-msg {
    font-size: 0.8rem;
    padding: 0 0 0 1.75rem;
    margin-bottom: 1rem;
}
.pp2-promo-msg-ok {
    color: #4caf50;
}
.pp2-promo-msg-err {
    color: #f44336;
}

/* Payment Method Row */
.pp2-method-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    cursor: default;
}

.pp2-method-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.pp2-method-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-btn);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.pp2-method-icon img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    border-radius: 5px;
}

.pp2-method-text {
    flex: 1;
    min-width: 0;
}

.pp2-method-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pp2-method-desc {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 0.1rem;
}

.pp2-method-change {
    background: none;
    border: none;
    color: var(--color-orange);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.pp2-method-change:hover {
    background: rgba(var(--color-orange-rgb), 0.12);
}

/* Pay Button */
.pp2-pay-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--bg-btn);
    border: 1px solid var(--border-btn);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pp2-pay-btn:hover {
    background: var(--bg-btn-hover);
    border-color: var(--border-btn-hover);
    color: var(--color-orange);
}

.pp2-pay-btn:active {
    transform: scale(0.98);
}

.pp2-pay-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

.pp2-pay-strike {
    margin-left: 0.5em;
    font-weight: 500;
    text-decoration: line-through;
    opacity: 0.55;
}

.pp2-status {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: rgba(255, 100, 100, 0.9);
    text-align: center;
    min-height: 1.2em;
}

/* ========================================
   PAYMENT METHOD POPUP OVERLAY
   ======================================== */
.pp2-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.pp2-popup {
    background: var(--bg-header);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    max-width: 420px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
}

.pp2-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.pp2-popup-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pp2-popup-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pp2-popup-close:hover {
    color: var(--color-orange);
    background: rgba(var(--color-orange-rgb), 0.1);
}

.pp2-popup-body {
    padding: 1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.pp2-popup-method {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.pp2-popup-method:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.pp2-popup-method.selected {
    border-color: var(--color-orange);
    background: rgba(var(--color-orange-rgb), 0.12);
}

.pp2-popup-method-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-btn);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.pp2-popup-method-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 6px;
}

.pp2-popup-method-text {
    flex: 1;
    min-width: 0;
}

.pp2-popup-method-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pp2-popup-method-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.15rem;
}

.pp2-popup-method-check {
    flex-shrink: 0;
    color: var(--color-orange);
    font-size: 1.1rem;
    font-weight: 700;
}

/* ========================================
   PURCHASE PANEL V2 - MOBILE
   ======================================== */
@media (max-width: 768px) {
    .purchase-panel-v2 {
        padding: 1.15rem;
    }

    .pp2-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .pp2-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }

    .pp2-title {
        font-size: 1.05rem;
    }

    .pp2-tariffs-grid {
        grid-template-columns: 1fr;
    }

    .pp2-tariff-card {
        padding: 0.85rem 1rem;
    }

    .pp2-tariff-price {
        font-size: 1.1rem;
    }

    /* Popup becomes bottom sheet on mobile */
    .pp2-popup-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .pp2-popup {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 80vh;
    }

    .pp2-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .pp2-icon .sub-step-icon-img {
        width: 20px;
        height: 20px;
    }
}

/* Highlight animation for tariff preselected from landing page */
@keyframes presetHighlightPulse {
    0%   { box-shadow: 0 0 0 0 rgba(var(--color-orange-rgb), 0.7), 0 0 0 0 rgba(var(--color-orange-rgb), 0); }
    50%  { box-shadow: 0 0 0 6px rgba(var(--color-orange-rgb), 0.35), 0 0 24px 4px rgba(var(--color-orange-rgb), 0.4); }
    100% { box-shadow: 0 0 0 0 rgba(var(--color-orange-rgb), 0), 0 0 0 0 rgba(var(--color-orange-rgb), 0); }
}
.pp2-tariff-card.preset-highlight {
    animation: presetHighlightPulse 1.2s ease-in-out 2;
}
