/* Order Modal Styles (shared across home, proxy list, and country detail pages) */
    /* Order Modal Modern styles */
    .modal-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        /* Neutral dark dim that matches the page background (no blue cast);
           kept light so the blur doesn't wash out the backdrop. */
        background: rgba(10, 10, 10, 0.55);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        z-index: 9998;
        align-items: center;
        justify-content: center;
        padding: 1rem;
    }

    .modal-overlay.active {
        display: flex;
    }

    .modal {
        background-color: var(--bg-primary);
        border: 1px solid var(--border);
        border-radius: 20px;
        width: 100%;
        max-width: 540px;
        max-height: 90vh;
        overflow-y: auto;
        padding: 2rem;
        box-shadow: var(--card-shadow), 0 0 0 1px rgba(249, 115, 22, 0.06), 0 24px 60px -20px rgba(0, 0, 0, 0.55);
        position: relative;
        animation: modalSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        display: block;
        margin: 0;
        background-image: linear-gradient(180deg, rgba(249, 115, 22, 0.06) 0%, transparent 12%);
    }

    .modal-overlay.active .modal {
        will-change: transform, opacity;
    }

    @keyframes modalSlideIn {
        from {
            opacity: 0;
            transform: translateY(-14px) scale(0.98);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

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

    .modal-header-left {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        min-width: 0;
    }

    .modal-back-btn {
        background: var(--bg-secondary);
        border: 1px solid var(--border);
        color: var(--text-secondary);
        cursor: pointer;
        width: 32px;
        height: 32px;
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .modal-back-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
        transform: translateX(-2px);
    }

    .modal-title-section {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .modal-flag {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border-radius: 12px;
        background: rgba(249, 115, 22, 0.08);
        color: var(--primary);
        font-size: 1.6rem;
    }

    .modal-title {
        font-family: var(--font-heading);
        font-size: 1.2rem;
        font-weight: 700;
        letter-spacing: -0.01em;
        color: var(--text-primary);
        margin: 0;
    }

    .modal-close, .close-btn {
        background: var(--bg-secondary);
        border: 1px solid var(--border);
        font-size: 0.8rem;
        color: var(--text-secondary);
        cursor: pointer;
        width: 32px;
        height: 32px;
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .modal-close:hover, .close-btn:hover {
        color: var(--primary);
        border-color: var(--primary);
        transform: scale(1.05) rotate(90deg);
    }

    .modal-body {
        padding: 0;
    }

    .modal-section {
        margin-bottom: 1.25rem;
    }

    .modal-section:last-child {
        margin-bottom: 0;
    }

    .modal-label {
        font-size: 0.72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--text-secondary);
        margin-bottom: 0.75rem;
        display: block;
    }

    .crypto-minimal-panel {
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 0.8rem;
        background: var(--bg-secondary);
    }

    .crypto-minimal-qr {
        width: 186px;
        height: 186px;
        border-radius: 12px;
        border: 1px solid var(--border);
        background: var(--bg-secondary);
        padding: 0.3rem;
        object-fit: contain;
    }

    .option-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
    }

    .option-btn {
        position: relative;
        padding: 0.5rem 0.65rem;
        border: 1px solid var(--border);
        background: var(--bg-secondary);
        border-radius: 10px;
        cursor: pointer;
        transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        text-align: center;
        font-weight: 500;
        color: var(--text-primary);
        /* Matches the height of .submit-btn (Continue to Checkout) so
           every button in the modal -- operator, network, duration, and
           the final action -- reads as one consistent size. Fixed so a
           group with a "No Stock" line doesn't grow taller than its
           sibling groups. */
        min-height: 3.1rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        line-height: 1.2;
    }

    .option-btn:hover {
        border-color: var(--primary);
        transform: translateY(-1px);
    }

    .option-btn.active {
        background: var(--primary);
        border-color: var(--primary);
        color: var(--white);
        box-shadow: 0 4px 12px var(--glow-color);
    }

    [data-theme="dark"] .option-btn.active {
        color: #1a1a1a;
    }

    .option-btn-label {
        display: block;
        font-size: 0.64rem;
        margin-bottom: 0.15rem;
        opacity: 0.75;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .option-btn-value {
        display: block;
        font-size: 0.85rem;
        font-weight: 600;
    }

    .option-stock-badge {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        color: #dc3545;
        font-size: 0.58rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }

    .option-stock-badge .pxm2-icon {
        width: 9px;
        height: 9px;
        flex-shrink: 0;
    }

    .price-display {
        background: radial-gradient(circle at top, rgba(249, 115, 22, 0.08) 0%, var(--bg-secondary) 70%);
        padding: 0.85rem;
        border-radius: 12px;
        border: 1px solid var(--border);
        text-align: center;
    }

    .price-display-label {
        font-size: 0.65rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-secondary);
        margin-bottom: 0.25rem;
    }

    .price-display-amount {
        font-family: var(--font-heading);
        font-size: 1.7rem;
        font-weight: 800;
        letter-spacing: -0.02em;
        color: var(--primary);
    }

    /* Feature highlights -- given the visual weight so buyers register
       what they're getting (bandwidth, activation, rotation, security)
       before their eye ever lands on the price. */
    .modal-highlights {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .modal-highlight-item {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.4rem 0.5rem;
        border-radius: 8px;
        background: rgba(249, 115, 22, 0.06);
        border: 1px solid rgba(249, 115, 22, 0.15);
        color: var(--text-primary);
        font-size: 0.68rem;
        font-weight: 600;
        text-align: center;
    }

    .modal-highlight-item .pxm2-icon {
        color: var(--primary);
        flex-shrink: 0;
        width: 13px;
        height: 13px;
    }

    /* Price + CTA -- price is intentionally small and secondary so the
       button remains the focal point of the step. */
    .modal-cta-section {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .price-inline-row {
        display: flex;
        align-items: baseline;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .price-inline-label {
        font-size: 0.72rem;
        color: var(--text-secondary);
    }

    /* Struck-through "was" price -- shows the real cost of paying at the
       previous duration's rate for this long (e.g. what a month would
       cost at the weekly rate), so the new price reads as a genuine
       tiered-pricing saving. */
    .price-inline-original {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-secondary);
        text-decoration: line-through;
        text-decoration-color: var(--danger);
        opacity: 0.8;
    }

    .price-inline-amount {
        font-size: 1.3rem;
        font-weight: 700;
        color: var(--text-primary);
    }

    .price-inline-suffix {
        font-size: 0.8rem;
        font-weight: 500;
        color: var(--text-secondary);
        margin-left: -0.2rem;
    }

    .price-inline-save {
        font-size: 0.62rem;
        font-weight: 700;
        color: var(--success);
        background: rgba(16, 185, 129, 0.12);
        padding: 0.15rem 0.4rem;
        border-radius: 999px;
        white-space: nowrap;
    }

    /* Reassurance line under the CTA -- reduces last-step hesitation. */
    .modal-reassurance {
        text-align: center;
        font-size: 0.72rem;
        color: var(--text-secondary);
        margin: 0;
    }

    .modal-reassurance .dot {
        color: var(--border);
        margin: 0 0.15rem;
    }

    .modal-reassurance a {
        color: var(--primary);
        text-decoration: none;
        font-weight: 600;
    }

    .modal-reassurance a:hover {
        text-decoration: underline;
    }

    .auth-section {
        background: var(--bg-secondary);
        padding: 1.25rem;
        border-radius: 14px;
        border: 1px solid var(--border);
    }

    .auth-tabs {
        display: flex;
        gap: 0.5rem;
        margin-bottom: 1rem;
        border-bottom: 1px solid var(--border);
    }

    .auth-tab {
        flex: 1;
        padding: 0.75rem;
        border: none;
        background: transparent;
        border-bottom: 2px solid transparent;
        margin-bottom: -1px;
        cursor: pointer;
        font-weight: 600;
        color: var(--text-secondary);
        transition: all 0.25s;
    }

    .auth-tab.active {
        color: var(--primary);
        border-bottom-color: var(--primary);
    }
    
    .auth-form {
        display: none;
    }
    
    .auth-form.active {
        display: block;
    }
    
    .form-input {
        width: 100%;
        padding: 0.875rem;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--bg-primary);
        color: var(--text-primary);
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
        transition: border-color 0.3s;
    }
    
    .form-input:focus {
        outline: none;
        border-color: var(--primary);
    }
    
    .submit-btn {
        width: 100%;
        padding: 0.95rem;
        background: var(--primary);
        color: var(--white);
        border: none;
        border-radius: 12px;
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        margin-top: 0.75rem;
        box-shadow: 0 4px 12px var(--glow-color);
    }

    [data-theme="dark"] .submit-btn {
        color: #1a1a1a;
    }

    /* Main checkout CTA -- a deeper amber/red gradient (still the site's
       warm hue family) so it reads as distinct from the lighter-orange
       option buttons surrounding it, without introducing an unrelated
       color like blue/green. */
    .submit-btn.cta-btn {
        background: linear-gradient(135deg, var(--warning) 0%, var(--primary-dark) 100%);
        box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
    }

    [data-theme="dark"] .submit-btn.cta-btn {
        color: #1a1400;
    }

    .submit-btn.cta-btn:hover:not(:disabled) {
        background: linear-gradient(135deg, var(--warning) 0%, var(--primary-dark) 100%);
        filter: brightness(1.08);
        box-shadow: 0 6px 22px rgba(245, 158, 11, 0.45);
    }

    .submit-btn:hover:not(:disabled) {
        background: var(--primary-dark);
        transform: translateY(-1px);
        box-shadow: 0 6px 20px var(--glow-color);
    }

    .submit-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        box-shadow: none;
    }
    
    .terms-notice {
        text-align: center;
        font-size: 0.8rem;
        color: var(--text-secondary);
        margin-bottom: 0.75rem;
        line-height: 1.4;
    }
    
    .terms-notice a {
        color: var(--primary);
        text-decoration: none;
    }
    
    .terms-notice a:hover {
        text-decoration: underline;
    }
    
    .card-element {
        padding: 1rem;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--bg-primary);
        margin-bottom: 1rem;
    }
    
    .saved-cards-list {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .saved-card-item {
        padding: 1rem;
        border: 2px solid var(--border);
        border-radius: 8px;
        background: var(--bg-primary);
        cursor: pointer;
        transition: all 0.2s;
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    .saved-card-item:hover {
        border-color: var(--primary);
    }
    
    .saved-card-item.selected {
        border-color: var(--primary);
        background: rgba(255, 140, 0, 0.1);
    }
    
    .saved-card-icon {
        display: inline-flex;
    }

    .saved-card-icon svg {
        width: 1.5rem;
        height: 1.5rem;
    }

    .submit-btn svg,
    .toast svg {
        width: 1.1em;
        height: 1.1em;
        flex-shrink: 0;
        vertical-align: -0.15em;
    }

    .saved-card-info {
        flex: 1;
    }
    
    .saved-card-brand {
        font-weight: 600;
        color: var(--text-primary);
        text-transform: capitalize;
    }
    
    .saved-card-number {
        color: var(--text-secondary);
        font-size: 0.9rem;
    }
    
    .add-card-btn, .edit-billing-btn {
        width: 100%;
        padding: 0.875rem;
        border: 2px dashed var(--border);
        border-radius: 8px;
        background: transparent;
        color: var(--text-primary);
        cursor: pointer;
        transition: all 0.2s;
        font-weight: 500;
    }
    
    .add-card-btn:hover, .edit-billing-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
    }
    
    .billing-address-display {
        padding: 1rem;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--bg-primary);
        color: var(--text-primary);
        margin-bottom: 0.75rem;
        line-height: 1.6;
    }
    
    .error-message {
        color: var(--danger);
        font-size: 0.875rem;
        margin-top: 0.5rem;
        display: none;
    }
    
    .error-message.show {
        display: block;
    }
    
    /* Toast Notifications */
    .toast {
        position: fixed;
        top: 20px;
        right: 20px;
        background: #10b981;
        color: white;
        padding: 1rem 1.5rem;
        border-radius: 8px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        z-index: 10002;
        animation: slideIn 0.3s ease-out;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        max-width: 400px;
    }
    
    .toast.error {
        background: #ef4444;
    }
    
    .toast.warning {
        background: #f59e0b;
    }
    
    @keyframes slideIn {
        from {
            transform: translateX(400px);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }
    
    @keyframes slideOut {
        from {
            transform: translateX(0);
            opacity: 1;
        }
        to {
            transform: translateX(400px);
            opacity: 0;
        }
    }
    
    .form-input {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--bg-primary);
        color: var(--text-primary);
        font-size: 1rem;
        transition: border-color 0.2s;
    }
    
    .form-input:focus {
        outline: none;
        border-color: var(--primary);
    }
    
    .form-input::placeholder {
        color: var(--text-secondary);
    }
    
    /* Responsive */
    @media (max-width: 768px) {
        .modal {
            max-height: 95vh;
        }
        
        .option-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }

