/* ═══════════════════════════════════════════════════════════════
   CapVPN Design System — assets/css/capvpn.css
   Shared tokens, reset, layout, header, footer & utilities.
   ═══════════════════════════════════════════════════════════════ */

/* ─── DESIGN TOKENS ─── */
:root {
    --bg-0: #060608;
    --bg-1: #0D0D12;
    --bg-2: #13131A;
    --bg-3: #1A1A24;
    --bg-card: rgba(19, 19, 26, 0.8);

    --cyan: #00F5FF;
    --cyan-dim: rgba(0, 245, 255, 0.15);
    --cyan-glow: 0 0 40px rgba(0, 245, 255, 0.25);
    --violet: #7C3AED;
    --violet-dim: rgba(124, 58, 237, 0.15);
    --rose: #F43F5E;
    --emerald: #10B981;
    --amber: #F59E0B;

    --text-1: #F0F0F8;
    --text-2: #8888A8;
    --text-3: #44445A;

    --border: rgba(255, 255, 255, 0.07);
    --border-active: rgba(0, 245, 255, 0.35);
    --gradient: linear-gradient(135deg, #00F5FF 0%, #7C3AED 100%);
    --gradient-r: linear-gradient(135deg, #7C3AED 0%, #00F5FF 100%);
    --shadow-glow: 0 20px 60px rgba(0, 245, 255, 0.12);

    --font-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --header-height: 72px;
}

/* ─── RESET ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
img, picture, video, svg { max-width: 100%; height: auto; display: block; }

body {
    font-family: var(--font-base);
    background: var(--bg-0);
    color: var(--text-1);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-base);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-1);
}

p { margin-bottom: 1rem; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: none; }
.btn, .btn:hover { text-decoration: none; }

img { max-width: 100%; height: auto; display: block; }

/* ─── ACCESSIBILITY ─── */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--gradient);
    color: #000;
    padding: 0.5rem 1rem;
    font-weight: 700;
    z-index: 10000;
    transition: top 0.2s;
}
.skip-link:focus { top: 0; }

*:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ─── SCROLL PROGRESS ─── */
#scroll-progress {
    position: fixed; top: 0; left: 0; height: 3px; z-index: 9999;
    background: var(--gradient); width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px var(--cyan);
}

/* ─── LOADER ─── */
.loader-wrap {
    position: fixed; inset: 0; background: var(--bg-0); z-index: 9998;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.6s, visibility 0.6s;
}
.loader-wrap.gone { opacity: 0; visibility: hidden; }
.loader-ring {
    width: 52px; height: 52px; border-radius: 50%;
    border: 3px solid var(--bg-3); border-top-color: var(--cyan);
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── BACK TO TOP ─── */
#back-top {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    width: 44px; height: 44px;
    background: var(--gradient); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: none; color: #000; z-index: 500;
    opacity: 0; transform: translateY(20px);
    transition: all 0.3s; box-shadow: var(--shadow-glow);
}
#back-top.show { opacity: 1; transform: translateY(0); }
#back-top:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0, 245, 255, 0.3); }

/* ─── COOKIE BANNER ─── */
#cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 800;
    background: var(--bg-2); border-top: 1px solid var(--border);
    padding: 1rem 1.5rem; display: flex; align-items: center;
    justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    transform: translateY(100%); transition: transform 0.4s ease;
    backdrop-filter: blur(20px);
}
#cookie-banner.show { transform: translateY(0); }
#cookie-banner p { font-size: 0.85rem; color: var(--text-2); flex: 1; min-width: 200px; margin: 0; }
#cookie-banner p a { color: var(--cyan); }
.cookie-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
#cookie-banner .btn { font-size: 0.82rem; padding: 0.45rem 0.9rem; }

/* ─── CONTAINER ─── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }
.container-sm { max-width: 860px; }
.container-md { max-width: 980px; }

/* ─── HEADER ─── */
header, .main-header {
    position: sticky; top: 0; left: 0; right: 0; z-index: 600;
    padding: 0.85rem 0;
    background: rgba(6, 6, 8, 0.85);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s;
}
header.scrolled, .main-header.scrolled { padding: 0.65rem 0; background: rgba(6, 6, 8, 0.97); }
.hdr { display: flex; align-items: center; justify-content: space-between; }

.logo { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.logo img { height: 38px; width: 38px; border-radius: 10px; object-fit: cover; }
.logo-text { font-size: 1.4rem; font-weight: 800; color: var(--text-1); }
.logo-text em { font-style: normal; color: var(--cyan); }

nav { display: flex; align-items: center; gap: 1.75rem; }
nav a {
    color: var(--text-2); text-decoration: none; font-size: 0.9rem;
    font-weight: 500; transition: color 0.2s; position: relative; padding-bottom: 2px;
}
nav a::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 0; height: 2px; background: var(--gradient); transition: width 0.3s;
}
nav a:hover, nav a.active { color: var(--text-1); }
nav a:hover::after, nav a.active::after { width: 100%; }

.hdr-actions { display: flex; align-items: center; gap: 0.75rem; }

/* IP / Top Status Bar */
.ip-status-bar, .top-status-bar {
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    padding: 0.55rem 0;
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    z-index: 610;
}
.ip-status-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}
.ip-bar-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.ip-bar-sep { color: var(--text-2); opacity: 0.5; }
.ip-bar-label { color: var(--text-2); }
.ip-bar-val { color: var(--text-1); font-weight: 500; }
.ip-bar-status {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.ip-bar-status.exposed { color: var(--rose); }
.ip-bar-status.protected { color: var(--emerald); }
.ip-bar-status.checking { color: var(--amber); }

@media (max-width: 640px) {
    .ip-status-inner { gap: 0.75rem; font-size: 0.78rem; }
}

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    padding: 0.65rem 1.25rem; border-radius: var(--radius-md); font-weight: 600;
    font-size: 0.88rem; text-decoration: none; cursor: pointer;
    border: none; transition: all 0.25s;
    font-family: var(--font-base);
    position: relative; overflow: hidden; white-space: nowrap;
}
.btn-ghost {
    background: transparent; color: var(--text-2);
    border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text-1); border-color: var(--border-active); background: var(--cyan-dim); }
.btn-primary { background: var(--gradient); color: #000; font-weight: 700; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0, 245, 255, 0.3); filter: brightness(1.1); }
.btn-outline { background: transparent; color: var(--cyan); border: 1.5px solid var(--cyan); }
.btn-outline:hover { background: var(--cyan-dim); transform: translateY(-2px); }
.btn-lg { padding: 0.9rem 1.75rem; font-size: 0.98rem; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }

.hamburger { display: none; background: none; border: none; color: var(--text-1); cursor: pointer; padding: 6px; border-radius: var(--radius-sm); }
.hamburger:hover { background: var(--bg-3); }

/* ─── MOBILE NAV ─── */
.mob-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.7); z-index: 699;
    opacity: 0; transition: opacity 0.3s;
}
.mob-overlay.on { display: block; opacity: 1; }
.mob-nav {
    display: none; flex-direction: column;
    position: fixed; top: 0; right: -100%; bottom: 0;
    width: min(300px, 85vw); background: var(--bg-1);
    border-left: 1px solid var(--border); z-index: 700;
    padding: 1.5rem; transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}
.mob-nav.on { display: flex; right: 0; }
.mob-nav-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.mob-close { background: none; border: none; color: var(--text-1); cursor: pointer; padding: 6px; border-radius: var(--radius-sm); }
.mob-links a {
    display: block; padding: 0.85rem 0; color: var(--text-2);
    text-decoration: none; border-bottom: 1px solid var(--border);
    font-size: 0.95rem; transition: color 0.2s;
}
.mob-links a:hover { color: var(--cyan); }
.mob-cta { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.mob-cta .btn { width: 100%; justify-content: center; }

/* ─── MAIN CONTENT OFFSET (fixed header + announce bar) ─── */
#main-content { outline: none; }
.page-wrap { padding-top: var(--header-height); min-height: 100vh; }
.page-header {
    padding: 4rem 0 3rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: var(--bg-1);
}
.page-header h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 0.75rem; }
.page-header p { color: var(--text-2); max-width: 640px; margin: 0 auto; font-size: 1.05rem; }
.page-body { padding: 3rem 0 5rem; }

/* ─── TYPOGRAPHY UTILITIES ─── */
.grad-text {
    background: var(--gradient); -webkit-background-clip: text;
    background-clip: text; color: transparent;
}
.text-center { text-align: center; }
.text-muted { color: var(--text-2); }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.lead { font-size: 1.15rem; color: var(--text-2); line-height: 1.75; }

/* ─── CARDS & GRIDS ─── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    backdrop-filter: blur(10px);
}
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ─── FORMS ─── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text-1); }
.form-input, .form-select, .form-textarea {
    width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    color: var(--text-1);
    font-family: var(--font-base);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--border-active);
    box-shadow: 0 0 0 3px var(--cyan-dim);
    outline: none;
}
.form-input::placeholder { color: var(--text-3); }
.form-textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: 0.8rem; color: var(--text-2); margin-top: 0.35rem; }
.form-error { color: var(--rose); font-size: 0.85rem; margin-top: 0.35rem; }

/* ─── TABLES ─── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
 thead { background: var(--bg-2); }
th { font-weight: 700; color: var(--text-1); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
td { color: var(--text-2); font-size: 0.9rem; }

/* ─── FOOTER ─── */
footer { background: var(--bg-1); padding: 4rem 0 2rem; border-top: 1px solid var(--border); }
.footer-top { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 2.5rem; margin-bottom: 3rem; }
.footer-brand p { color: var(--text-2); font-size: 0.88rem; margin: 0.85rem 0 1.25rem; line-height: 1.7; }
.footer-social { display: flex; gap: 0.6rem; }
.footer-social a {
    width: 38px; height: 38px; border-radius: 50%; background: var(--bg-3);
    border: 1px solid var(--border); display: flex; align-items: center;
    justify-content: center; color: var(--text-2); text-decoration: none; transition: all 0.25s;
}
.footer-social a:hover { background: var(--gradient); color: #000; border-color: transparent; transform: translateY(-2px); }
.footer-col h4 { font-size: 0.82rem; font-weight: 700; color: var(--text-1); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.65rem; }
.footer-col a { color: var(--text-2); text-decoration: none; font-size: 0.88rem; transition: color 0.2s; display: inline-flex; align-items: center; gap: 0.3rem; }
.footer-col a:hover { color: var(--cyan); }
.footer-bot { border-top: 1px solid var(--border); padding-top: 2rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-bot p { color: var(--text-3); font-size: 0.82rem; margin: 0; }
.footer-legal { display: flex; gap: 1.25rem; }
.footer-legal a { color: var(--text-3); text-decoration: none; font-size: 0.82rem; transition: color 0.2s; }
.footer-legal a:hover { color: var(--text-2); }

/* ─── AUTH PAGES ─── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
}
.auth-card h1 { font-size: 1.75rem; margin-bottom: 1.5rem; }
.auth-card .logo { justify-content: center; margin-bottom: 1.5rem; }
.auth-card .form-input { margin-bottom: 1rem; }
.auth-card .btn { width: 100%; margin-top: 0.5rem; }
.auth-card p { margin-top: 1.25rem; color: var(--text-2); font-size: 0.9rem; }
.auth-card a { color: var(--cyan); }
.auth-error { color: var(--rose); margin-bottom: 1rem; display: none; }
.auth-success { color: var(--emerald); margin-bottom: 1rem; display: none; }
.otp-input {
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 8px;
    font-family: var(--font-mono);
}
.resend-btn {
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--border);
    margin-top: 1rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    width: 100%;
    transition: all 0.2s;
}
.resend-btn:hover:not(:disabled) { background: var(--bg-3); color: var(--text-1); }
.resend-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ─── CONTENT PAGES ─── */
.page-body h2 { font-size: 1.4rem; margin: 2.5rem 0 0.75rem; }
.page-body h3 { font-size: 1.15rem; margin: 2rem 0 0.5rem; color: var(--text-1); }
.page-body p { margin-bottom: 1rem; }
.page-body ul, .page-body ol { padding-left: 1.25rem; margin-bottom: 1rem; }
.page-body li { margin-bottom: 0.5rem; }
.page-body .card p:last-child { margin-bottom: 0; }

/* ─── CONTENT PAGE EXTRAS ─── */
.last-updated { color: var(--text-2); font-style: italic; margin-bottom: 2rem; }
.entry { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem; }
.entry .date { font-size: 0.85rem; color: var(--text-2); margin-bottom: 0.5rem; }
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; margin-right: 0.4rem; }
.badge.feature { background: var(--cyan-dim); color: var(--cyan); }
.badge.fix { background: var(--violet-dim); color: #a78bfa; }
.badge.security { background: rgba(244, 63, 94, 0.15); color: #f87171; }

/* ─── UTILITY CLASSES ─── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--text-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 245, 255, 0.3); }

.order-1 { order: 1; }
.order-2 { order: 2; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
    nav, .hdr-actions { display: none; }
    .hamburger { display: flex; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .page-header { padding: 3rem 0 2rem; }
    .page-header h1 { font-size: 2rem; }
    .page-body { padding: 2rem 0 3rem; }
    .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .footer-top { grid-template-columns: 1fr; }
    .footer-bot { flex-direction: column; text-align: center; }
    .footer-legal { justify-content: center; }
    .ip-status-inner { gap: 0.6rem; font-size: 0.78rem; }
    .ip-bar-sep { display: none; }
    .ip-bar-item { flex: 1 1 auto; justify-content: center; }
    #ip-bar-ipv6-wrap, #ip-bar-protocol-wrap { display: none !important; }
}

@media (max-width: 480px) {
    .container { padding: 0 1rem; }
    .btn-lg { width: 100%; justify-content: center; }
    #cookie-banner { flex-direction: column; align-items: flex-start; }
    .cookie-actions { width: 100%; }
    .cookie-actions .btn { flex: 1; }
    .ip-status-inner { font-size: 0.72rem; gap: 0.4rem; }
}
/* Exit intent modal */
.exit-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.exit-modal.show { display: flex; }

.exit-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.exit-modal-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    animation: exitSlideUp 0.35s ease;
}

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

.exit-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-2);
    font-size: 1.5rem;
    cursor: pointer;
}

.exit-modal-close:hover { color: var(--text-1); }

.exit-modal-card h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.exit-modal-card p { color: var(--text-2); margin-bottom: 1.5rem; }

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.4s infinite;
    border-radius: 4px;
    color: transparent !important;
    pointer-events: none;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Breadcrumb navigation */
.breadcrumb-nav { margin-bottom: 1.5rem; }
.breadcrumb-list { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; font-size: 0.85rem; color: var(--text-2); }
.breadcrumb-item a { color: var(--cyan); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item:not(:last-child)::after { content: "/"; margin-left: 0.5rem; opacity: 0.5; }

/* Trust badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-2);
}

/* Better mobile / tablet UX */
@media (max-width: 768px) {
    .mob-links a {
        padding: 1rem 0;
        font-size: 1rem;
    }
    .mob-cta .btn {
        min-height: 48px;
    }
    .hamburger, .mob-close {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .hdr nav {
        gap: 1rem;
    }
    .hdr nav a {
        font-size: 0.9rem;
    }
}
