/* ============================================================
   ip4.bg — Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --bg:          #f0f4f8;
    --surface:     #ffffff;
    --surface-2:   #e8edf3;
    --border:      #d1dbe8;
    --text:        #1a2332;
    --text-muted:  #5a6a7e;
    --accent:      #2563eb;
    --accent-dark: #1d4ed8;
    --accent-light:#eff6ff;
    --success:     #10b981;
    --warning:     #f59e0b;
    --radius:      12px;
    --radius-lg:   20px;
    --shadow:      0 2px 12px rgba(37,99,235,0.08);
    --shadow-lg:   0 8px 32px rgba(37,99,235,0.13);
    --font-head:   'Sora', sans-serif;
    --font-body:   'DM Sans', sans-serif;
    --transition:  0.2s ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.7;
    min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; display: block; }

/* ── Layout ─────────────────────────────────────────────────── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}
.container--narrow {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.site-logo {
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.03em;
}
.site-logo span {
    color: var(--accent);
}

/* ── Navigation ─────────────────────────────────────────────── */
.site-nav--mobile { display: none; }

.site-nav--desktop {
    display: flex;
    align-items: center;
    gap: 2px;
}
.nav-link {
    font-family: var(--font-head);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 8px;
    transition: all var(--transition);
    white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
    background: var(--accent-light);
    color: var(--accent);
}

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown__trigger {
    font-family: var(--font-head);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all var(--transition);
    white-space: nowrap;
}
.nav-dropdown__trigger:hover,
.nav-dropdown__trigger.active {
    background: var(--accent-light);
    color: var(--accent);
}
.nav-dropdown__trigger svg { transition: transform var(--transition); }
.nav-dropdown:hover .nav-dropdown__trigger svg { transform: rotate(180deg); }
.nav-dropdown__menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 6px;
    z-index: 200;
}
.nav-dropdown__menu::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}
.nav-dropdown:hover .nav-dropdown__menu { display: block; }
.nav-dropdown__menu a {
    display: block;
    font-family: var(--font-head);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 6px;
    transition: all var(--transition);
    white-space: nowrap;
}
.nav-dropdown__menu a:hover,
.nav-dropdown__menu a.active {
    background: var(--accent-light);
    color: var(--accent);
}

/* Hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text);
}
.nav-toggle svg { display: block; }

/* ── Hero / IP Card ─────────────────────────────────────────── */
.hero {
    padding: 60px 0 40px;
}
.ip-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 48px 40px;
    text-align: center;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.ip-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), #7c3aed, #06b6d4);
}
.ip-label {
    font-family: var(--font-head);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.ip-address {
    font-family: var(--font-head);
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 8px;
    word-break: break-all;
}
.ip-address .loading-dots::after {
    content: '...';
    animation: dots 1.2s infinite;
}
@keyframes dots {
    0%, 20%  { content: '.'; }
    40%      { content: '..'; }
    60%,100% { content: '...'; }
}
.ip-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-head);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-light);
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 32px;
}
.ip-copy-btn:hover { background: #dbeafe; }
.ip-copy-btn.copied { color: var(--success); background: #d1fae5; border-color: #6ee7b7; }

/* ── Info Grid ──────────────────────────────────────────────── */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 32px;
    text-align: left;
}
.info-item {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px 18px;
    border: 1px solid var(--border);
}
.info-item__label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.info-item__value {
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}

/* ── Map ────────────────────────────────────────────────────── */
.map-section {
    margin-top: 32px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    height: 320px;
}
.map-section iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ── Check Form ─────────────────────────────────────────────── */
.check-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 36px 40px;
    margin: 32px 0;
    box-shadow: var(--shadow);
}
.check-section h2 {
    font-family: var(--font-head);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}
.check-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
}
.check-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    transition: border-color var(--transition);
    outline: none;
}
.check-form input[type="text"]:focus {
    border-color: var(--accent);
    background: var(--surface);
}
.check-form input[type="text"]::placeholder { color: var(--text-muted); }
.btn {
    font-family: var(--font-head);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn--primary {
    background: var(--accent);
    color: #fff;
}
.btn--primary:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37,99,235,0.3);
}
.h-captcha { margin-top: 12px; width: 100%; }

/* ── VPN Banner ─────────────────────────────────────────────── */
.vpn-banner {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    margin: 32px 0;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.vpn-banner__text h3 {
    font-family: var(--font-head);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.vpn-banner__text p {
    font-size: 0.9rem;
    opacity: 0.85;
    max-width: 480px;
}
.btn--white {
    background: #fff;
    color: var(--accent);
    font-weight: 700;
    white-space: nowrap;
}
.btn--white:hover {
    background: #f0f7ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* ── Ad Slot ────────────────────────────────────────────────── */
.ad-slot {
    background: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 24px 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Page Content ───────────────────────────────────────────── */
.page-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 48px;
    margin: 40px 0;
    box-shadow: var(--shadow);
}
.page-content h1 {
    font-family: var(--font-head);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    color: var(--text);
    line-height: 1.2;
}
.page-content h2 {
    font-family: var(--font-head);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 36px 0 14px;
    color: var(--text);
}
.page-content h3 {
    font-family: var(--font-head);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 24px 0 10px;
    color: var(--text);
}
.page-content p { margin-bottom: 16px; color: var(--text); }
.page-content ul, .page-content ol {
    margin: 12px 0 20px 24px;
}
.page-content li { margin-bottom: 8px; }
.page-content strong { font-weight: 600; color: var(--text); }
.page-content a { color: var(--accent); }
.page-content a:hover { text-decoration: underline; }

/* Lead paragraph */
.lead {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 28px;
    line-height: 1.8;
}

/* Highlight box */
.highlight-box {
    background: var(--accent-light);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 16px 20px;
    margin: 20px 0;
    font-size: 0.95rem;
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
    background: var(--text);
    color: rgba(255,255,255,0.7);
    padding: 48px 0 28px;
    margin-top: 60px;
}
.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-brand .site-logo { color: #fff; margin-bottom: 12px; }
.footer-brand p { font-size: 0.88rem; line-height: 1.7; }
.footer-col h4 {
    font-family: var(--font-head);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 14px;
}
.footer-col a {
    display: block;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 8px;
    transition: color var(--transition);
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    flex-wrap: wrap;
    gap: 12px;
}

/* ── Result Box (за проверка на чужд IP) ────────────────────── */
.result-box {
    background: var(--accent-light);
    border: 1.5px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-top: 20px;
    display: none;
}
.result-box.visible { display: block; }
.result-box h3 {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--accent);
}
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

/* ── Utility ────────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-32 { margin-top: 32px; }
.mb-32 { margin-bottom: 32px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .site-nav--desktop { display: none; }
    .nav-toggle { display: block; }
    .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; }

    .site-nav--mobile {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 12px 0 16px;
        gap: 2px;
    }
    .site-nav--mobile.open { display: flex; }
    .site-nav--mobile a {
        font-family: var(--font-head);
        font-size: 0.88rem;
        font-weight: 500;
        color: var(--text-muted);
        padding: 8px 12px;
        border-radius: 8px;
        transition: all var(--transition);
    }
    .site-nav--mobile a:hover,
    .site-nav--mobile a.active {
        background: var(--accent-light);
        color: var(--accent);
    }

    .ip-card { padding: 32px 20px; }
    .check-section { padding: 24px 20px; }
    .vpn-banner { padding: 28px 20px; flex-direction: column; text-align: center; }
    .page-content { padding: 28px 20px; }

    .footer-inner { grid-template-columns: 1fr; gap: 28px; }
    .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .info-grid { grid-template-columns: 1fr 1fr; }
    .check-form { flex-direction: column; }
    .check-form input[type="text"] { min-width: 100%; }
}
