* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #070b14;
    --bg-soft: #0d1526;
    --surface: rgba(14, 24, 42, 0.8);
    --surface-strong: rgba(16, 29, 52, 0.95);
    --text-main: #f4f8ff;
    --text-muted: #98a8c6;
    --primary: #56ccf2;
    --primary-strong: #2f80ed;
    --border: rgba(133, 165, 216, 0.22);
    --success: #25d18a;
    --warning: #ffb347;
    --danger: #ff6b6b;
    --radius-lg: 20px;
    --radius-md: 14px;
}

body {
    position: relative;
    font-family: Inter, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    padding: 28px 16px 56px;
    color: var(--text-main);
    background:
        radial-gradient(circle at 15% -10%, rgba(86, 204, 242, 0.26), transparent 45%),
        radial-gradient(circle at 88% 4%, rgba(47, 128, 237, 0.28), transparent 42%),
        linear-gradient(160deg, #05070d 0%, #081223 55%, #050913 100%);
}

.page-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 100%, rgba(37, 209, 138, 0.08), transparent 50%);
}

.container {
    max-width: 1040px;
    margin: 0 auto;
}

.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;
}

.hero {
    margin-bottom: 22px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(86, 204, 242, 0.95), rgba(47, 128, 237, 0.92));
    box-shadow: 0 16px 36px rgba(38, 151, 238, 0.35);
}

.logo-icon svg {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 2px 6px rgba(10, 22, 36, 0.5));
}

h1 {
    font-size: clamp(1.6rem, 3vw, 2.15rem);
    letter-spacing: 0.05em;
    font-weight: 800;
}

.subtitle {
    margin-top: 4px;
    color: var(--text-muted);
}

.hero-description {
    margin-top: 14px;
    max-width: 760px;
    line-height: 1.55;
    color: #d2def4;
}

.search-section,
.main-card,
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    backdrop-filter: blur(12px);
    contain: layout paint style;
}

.search-section {
    padding: 22px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
    margin-bottom: 24px;
}

.search-box {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
}

#ipInput {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(150, 177, 225, 0.32);
    color: var(--text-main);
    background: rgba(8, 18, 33, 0.85);
    font-size: 0.96rem;
    transition: 0.25s ease;
}

#ipInput::placeholder {
    color: #8294b5;
}

#ipInput:focus {
    outline: none;
    border-color: rgba(86, 204, 242, 0.8);
    box-shadow: 0 0 0 4px rgba(86, 204, 242, 0.15);
}

button {
    border: none;
    border-radius: 12px;
    padding: 13px 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn-primary {
    color: #041224;
    background: linear-gradient(120deg, #56ccf2, #2f80ed);
    box-shadow: 0 12px 24px rgba(48, 134, 236, 0.32);
}

.btn-secondary {
    color: var(--text-main);
    background: rgba(10, 21, 39, 0.95);
    border: 1px solid rgba(135, 170, 223, 0.4);
}

@media (hover: hover) {
    button:hover:not(:disabled) {
        transform: translateY(-2px);
    }

    .card:hover {
        transform: translateY(-3px);
        border-color: rgba(86, 204, 242, 0.6);
    }
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.error {
    display: none;
    margin-top: 12px;
    color: #ff8f8f;
    font-size: 0.9rem;
}

.error.show {
    display: block;
}

.spinner {
    display: none;
    width: 24px;
    height: 24px;
    margin: 14px auto 4px;
    border-radius: 50%;
    border: 2px solid rgba(86, 204, 242, 0.26);
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

.spinner.show {
    display: block;
}

.results {
    display: none;
    content-visibility: auto;
    contain-intrinsic-size: 1px 1100px;
}

.results.show {
    display: block;
    animation: fade-in 0.35s ease;
}

.main-card {
    background: linear-gradient(130deg, var(--surface-strong), rgba(14, 48, 92, 0.48));
    padding: 24px;
    margin-bottom: 18px;
    box-shadow: 0 18px 44px rgba(8, 14, 26, 0.45);
}

.eyebrow {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.main-info h2 {
    font-size: clamp(1.5rem, 4vw, 2.15rem);
    margin-bottom: 12px;
    color: #82ddff;
}

.location-info {
    display: flex;
    gap: 14px;
    align-items: center;
}

.flag {
    font-size: 2.75rem;
}

.location-details h3 {
    font-size: 1.35rem;
    margin-bottom: 3px;
}

.location-details p {
    color: var(--text-muted);
    margin-bottom: 8px;
}

.country-code {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.75rem;
    background: rgba(86, 204, 242, 0.14);
    color: #9de6ff;
    border: 1px solid rgba(86, 204, 242, 0.4);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.card {
    border-radius: var(--radius-md);
    padding: 18px;
    transition: 0.2s ease;
}

.card-title {
    font-size: 0.77rem;
    letter-spacing: 0.08em;
    color: #7ed9f8;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 10px;
}

.card-value {
    font-size: 1.04rem;
    font-weight: 700;
    margin-bottom: 7px;
    word-break: break-word;
}

.card-subtext {
    color: var(--text-muted);
    font-size: 0.84rem;
}

.security-card {
    margin-bottom: 0;
}

.badges-row {
    margin-top: 8px;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    margin: 0 8px 8px 0;
    border: 1px solid transparent;
}

.badge-yes {
    color: var(--success);
    background: rgba(37, 209, 138, 0.16);
    border-color: rgba(37, 209, 138, 0.45);
}

.badge-no {
    color: #c8d4ec;
    background: rgba(117, 137, 170, 0.2);
    border-color: rgba(117, 137, 170, 0.44);
}

.badge-warn {
    color: var(--warning);
    background: rgba(255, 179, 71, 0.16);
    border-color: rgba(255, 179, 71, 0.45);
}

.badge-danger {
    color: var(--danger);
    background: rgba(255, 107, 107, 0.14);
    border-color: rgba(255, 107, 107, 0.45);
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 820px) {
    .search-box {
        grid-template-columns: 1fr;
    }

    button {
        width: 100%;
    }

    .main-card {
        padding: 20px;
    }
}

@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;
    }

    .page-glow {
        display: none;
    }
}

@media (max-width: 820px), (pointer: coarse) {
    body {
        background: linear-gradient(160deg, #05070d 0%, #081223 55%, #050913 100%);
    }

    .page-glow {
        display: none;
    }

    .search-section,
    .main-card,
    .card {
        backdrop-filter: none;
        box-shadow: none;
    }

    .logo-icon,
    .btn-primary,
    .main-card {
        box-shadow: none;
    }
}
