@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── Tokens ─────────────────────────────────────────── */
:root {
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --primary-dark: #1d4ed8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --bg: #f0f4f8;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --radius-sm: 8px;
    --radius-md: 14px;
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, .06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .09);
    --t: 0.18s ease;
}

/* ─── Reset ──────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

button {
    cursor: pointer;
    font-family: inherit;
}

/* ─── Hero ───────────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #0284c7 100%);
    padding: 52px 24px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-eyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .65);
    margin-bottom: 10px;
}

.hero-ip {
    font-size: clamp(2rem, 8vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -.02em;
    font-feature-settings: 'tnum';
    color: #fff;
    min-height: 1.2em;
    transition: opacity var(--t);
    cursor: pointer;
    user-select: all;
}

.hero-ip.loading {
    opacity: .5;
}

.hero-sub {
    color: rgba(255, 255, 255, .7);
    font-size: .9rem;
    margin-top: 8px;
}

.ip-type-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.ip-pill {
    padding: 5px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .15);
    border: 1.5px solid rgba(255, 255, 255, .3);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t);
}

.ip-pill.active,
.ip-pill:hover {
    background: rgba(255, 255, 255, .28);
    border-color: rgba(255, 255, 255, .65);
}

.hero-ip:hover {
    opacity: .85;
}

/* ─── Layout ─────────────────────────────────────────── */
.main {
    max-width: 940px;
    margin: -36px auto 60px;
    padding: 0 18px;
    position: relative;
    z-index: 10;
}

/* ─── Section ────────────────────────────────────────── */
.section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px 22px;
    margin-bottom: 16px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    margin-bottom: 14px;
}

/* ─── IPv4/v6 dual row ───────────────────────────────── */
.dual-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.dual-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.dual-val {
    font-size: .95rem;
    font-weight: 600;
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 6px;
}

.na-text {
    color: var(--text-muted);
    font-size: .82rem;
    font-weight: 400;
}

.copy-i {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: .85rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color var(--t), background var(--t);
    flex-shrink: 0;
}

.copy-i:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.tag {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: .68rem;
    font-weight: 700;
    background: var(--primary-light);
    color: var(--primary);
}

.tag.v6 {
    background: #f0fdf4;
    color: #16a34a;
}

.tag.na {
    background: #fef9c3;
    color: #92400e;
}

/* ─── Info Grid ──────────────────────────────────────── */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.info-cell {
    background: var(--surface);
    padding: 12px 14px;
}

.ic-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.ic-val {
    font-size: .875rem;
    font-weight: 600;
    word-break: break-word;
}

.ic-val.ok {
    color: var(--success);
}

.ic-val.warn {
    color: var(--warning);
}

.ic-val.bad {
    color: var(--danger);
}

/* skeleton */
.sk {
    display: inline-block;
    border-radius: 4px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shim 1.4s infinite;
}

@keyframes shim {
    0% {
        background-position: 200% 0
    }

    100% {
        background-position: -200% 0
    }
}

/* ─── Location section ───────────────────────────────── */
.loc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 600;
    transition: background var(--t);
}

.loc-btn:hover {
    background: var(--primary-dark);
}

.loc-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.loc-result {
    margin-top: 14px;
    display: none;
}

.loc-result.visible {
    display: block;
}

.loc-addr {
    font-size: .875rem;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.8;
}

.loc-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    color: var(--primary);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 500;
}

.loc-link:hover {
    text-decoration: underline;
}

.loc-err {
    color: var(--danger);
    font-size: .875rem;
    margin-top: 10px;
}

/* ─── Toast ──────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: #1e293b;
    color: #fff;
    padding: 9px 22px;
    border-radius: 20px;
    font-size: .875rem;
    opacity: 0;
    transition: all .25s;
    pointer-events: none;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* === FAQ Section === */
.faq-section {
    width: 100%;
}

.faq-title {
    color: var(--text-dark);
}

.faq-item {
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fdfdfd;
    transition: background 0.2s;
}

.faq-item:hover {
    background: #f8f9fa;
}

.faq-item summary {
    padding: 1.2rem;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    list-style: none;
    /* Hide default arrow */
    position: relative;
    user-select: none;
    outline: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 1.2rem;
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-muted);
    transition: transform 0.3s;
}

.faq-item[open] summary::after {
    content: '−';
    transform: rotate(180deg);
}

.faq-item p {
    padding: 0 1.2rem 1.2rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.faq-item[open] summary {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
    background: var(--card-bg);
}

/* ─── Footer ─────────────────────────────────────────── */
footer {
    text-align: center;
    padding: 14px;
    font-size: .75rem;
    color: var(--text-muted);
}

footer a {
    color: inherit;
}

/* ─── RWD ────────────────────────────────────────────── */
@media (max-width: 560px) {
    .dual-row {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 40px 18px 70px;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 360px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}