/* VPN Detector — современное модальное окно */

.vpn-detector-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    box-sizing: border-box;
    background-color: rgba(15, 23, 42, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    transition: background-color 0.35s ease, backdrop-filter 0.35s ease;
}

.vpn-detector-overlay.vpn-detector-visible {
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.vpn-detector-overlay.vpn-detector-hiding {
    background-color: rgba(15, 23, 42, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
}

.vpn-detector-popup {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transform: translateY(16px) scale(0.97);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
    text-align: center;
}

.vpn-detector-visible .vpn-detector-popup {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.vpn-detector-hiding .vpn-detector-popup {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
}

.vpn-detector-dialog-surface {
    --vpn-accent: #f97316;
    position: relative;
    text-align: left;
    padding: 28px 28px 24px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.6) inset,
        0 24px 48px -12px rgba(15, 23, 42, 0.25),
        0 12px 24px -8px rgba(15, 23, 42, 0.12);
}

.vpn-detector-dialog-visual {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 8px;
}

.vpn-detector-dialog-icon-ring {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border-radius: 1.2rem;
    color: var(--vpn-accent, #f97316);
    background: linear-gradient(160deg, #fff 0%, #fff7ed 45%, #ffedd5 100%);
    border: 2px solid rgba(251, 146, 60, 0.45);
    box-shadow: 0 10px 28px rgba(234, 88, 12, 0.18);
}

.vpn-detector-dialog-svg {
    width: 44px;
    height: 44px;
}

.vpn-detector-dialog-header {
    margin-bottom: 12px;
}

.vpn-detector-dialog-body {
    margin-bottom: 8px;
}

/* Подсказки «что сделать» */
.vpn-detector-tips {
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.vpn-detector-tips-title {
    display: block;
    margin: 0 0 0.75rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.vpn-detector-tips-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vpn-detector-tip {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid rgba(15, 23, 42, 0.07);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.vpn-detector-tip:hover {
    border-color: rgba(251, 146, 60, 0.45);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 6px 20px rgba(15, 23, 42, 0.06);
}

.vpn-detector-tip-icon-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-top: 1px;
    border-radius: 12px;
    color: var(--vpn-accent);
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.12);
}

.vpn-detector-tip-icon {
    display: block;
    width: 22px;
    height: 22px;
}

.vpn-detector-tip-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.vpn-detector-tip-label {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
    color: #0f172a;
}

.vpn-detector-tip-desc {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #64748b;
}

.vpn-detector-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: rgba(241, 245, 249, 0.9);
    color: #64748b;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s;
}

.vpn-detector-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.vpn-detector-close:active {
    transform: scale(0.96);
}

.vpn-detector-close-icon {
    position: relative;
    width: 18px;
    height: 18px;
    display: block;
}

.vpn-detector-close-icon::before,
.vpn-detector-close-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}

.vpn-detector-close-icon::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.vpn-detector-close-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.vpn-detector-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.vpn-detector-message {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: #475569;
}

.vpn-detector-message p {
    margin: 0 0 12px;
}

.vpn-detector-message p:last-child {
    margin-bottom: 0;
}

.vpn-detector-message ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.vpn-detector-message ul li {
    padding: 4px 0 4px 20px;
    position: relative;
}

.vpn-detector-message ul li::before {
    content: "•";
    position: absolute;
    left: 5px;
    color: #f97316;
    font-weight: bold;
}

.vpn-detector-popup-footer {
    margin: 16px 0 4px;
    text-align: center;
    font-size: 0.875rem;
}

.vpn-detector-privacy-link {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.vpn-detector-privacy-link:hover {
    color: #1d4ed8;
}

.vpn-detector-dialog-actions.vpn-detector-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.vpn-detector-btn {
    width: 100%;
    min-width: 0;
    padding: 14px 20px;
    border: none;
    border-radius: 14px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
    text-align: center;
}

.vpn-detector-btn-primary {
    color: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
}

.vpn-detector-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.22);
}

.vpn-detector-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid rgba(148, 163, 184, 0.45);
}

.vpn-detector-btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

@media (max-width: 576px) {
    .vpn-detector-dialog-surface {
        padding: 24px 20px 20px;
        border-radius: 18px;
    }
    .vpn-detector-title {
        font-size: 1.2rem;
        padding-right: 36px;
    }
    .vpn-detector-dialog-icon-ring {
        width: 76px;
        height: 76px;
    }
    .vpn-detector-dialog-svg {
        width: 38px;
        height: 38px;
    }
    .vpn-detector-tip {
        padding: 12px 14px;
        gap: 12px;
    }
    .vpn-detector-tip-icon-wrap {
        width: 36px;
        height: 36px;
    }
    .vpn-detector-tip-icon {
        width: 20px;
        height: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vpn-detector-overlay,
    .vpn-detector-popup,
    .vpn-detector-btn {
        transition: none !important;
    }
    .vpn-detector-btn-primary:hover {
        transform: none;
    }
}

@media (prefers-color-scheme: dark) {
    .vpn-detector-dialog-surface {
        background: #1e293b;
        border-color: rgba(148, 163, 184, 0.15);
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.06) inset,
            0 24px 48px -12px rgba(0, 0, 0, 0.45);
    }
    .vpn-detector-title {
        color: #f8fafc !important;
    }
    .vpn-detector-message {
        color: #cbd5e1;
    }
    .vpn-detector-tips {
        border-top-color: rgba(148, 163, 184, 0.2);
    }
    .vpn-detector-tips-title {
        color: #94a3b8;
    }
    .vpn-detector-tip {
        background: linear-gradient(145deg, #334155 0%, #1e293b 100%);
        border-color: rgba(148, 163, 184, 0.18);
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
    }
    .vpn-detector-tip:hover {
        border-color: rgba(251, 146, 60, 0.4);
    }
    .vpn-detector-tip-icon-wrap {
        background: #1e293b;
        border-color: rgba(148, 163, 184, 0.25);
        box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.2);
    }
    .vpn-detector-tip-label {
        color: #f1f5f9;
    }
    .vpn-detector-tip-desc {
        color: #94a3b8;
    }
    .vpn-detector-close {
        background: rgba(51, 65, 85, 0.85);
        color: #94a3b8;
    }
    .vpn-detector-close:hover {
        background: #334155;
        color: #f1f5f9;
    }
    .vpn-detector-privacy-link {
        color: #93c5fd;
    }
    .vpn-detector-privacy-link:hover {
        color: #bfdbfe;
    }
    .vpn-detector-btn-secondary {
        background: #334155;
        color: #e2e8f0;
        border-color: rgba(148, 163, 184, 0.25);
    }
    .vpn-detector-btn-secondary:hover {
        background: #475569;
        color: #fff;
    }
}
