/* NexoraHost — Frankfurt latency tool */

.nx-latency {
    --nx-lat-max: 920px;
    max-width: var(--nx-lat-max);
    margin: 24px auto 64px;
    padding: 0 18px;
    color: var(--nx-text, #f5f4fb);
}

.nx-latency__hero {
    margin-bottom: 22px;
}

.nx-latency__kicker {
    margin: 0 0 8px;
    color: #c4b5fd;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nx-latency__hero h1 {
    margin: 0 0 10px;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    letter-spacing: -0.04em;
}

.nx-latency__lead {
    margin: 0;
    max-width: 54ch;
    color: var(--nx-muted, #a6a5b8);
    line-height: 1.55;
}

.nx-latency__card {
    padding: 22px 22px 20px;
    background:
        radial-gradient(500px 220px at 10% -20%, rgba(192, 38, 244, 0.16), transparent 60%),
        #14141f;
    border: 1px solid var(--nx-line, #2b2b40);
    border-radius: 18px;
    box-shadow: inset 3px 0 0 rgba(192, 38, 244, 0.55);
}

.nx-latency__card.is-great { box-shadow: inset 3px 0 0 #20d69a; }
.nx-latency__card.is-good { box-shadow: inset 3px 0 0 #38bdf8; }
.nx-latency__card.is-ok { box-shadow: inset 3px 0 0 #f5b52e; }
.nx-latency__card.is-high { box-shadow: inset 3px 0 0 #f04465; }

.nx-latency__dc {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.nx-latency__dc strong {
    display: block;
    letter-spacing: -0.02em;
}

.nx-latency__dc small {
    color: #a6a5b8;
}

.nx-latency__badge {
    margin-left: auto;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #2b2b40;
    background: #12121c;
    color: #a6a5b8;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.nx-latency__badge.is-ok {
    color: #bbf7d0;
    border-color: rgba(32, 214, 154, 0.45);
    background: rgba(32, 214, 154, 0.12);
}

.nx-latency__badge.is-bad {
    color: #fecdd3;
    border-color: rgba(240, 68, 101, 0.45);
    background: rgba(240, 68, 101, 0.12);
}

.nx-latency__target {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
}

.nx-latency__target > div {
    padding: 10px 12px;
    border: 1px solid #2b2b40;
    border-radius: 12px;
    background: rgba(18, 18, 28, 0.85);
}

.nx-latency__target span {
    display: block;
    margin-bottom: 4px;
    color: #8d8ca3;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nx-latency__target strong {
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    word-break: break-word;
}

.nx-latency__target code {
    font-size: 0.78em;
    color: #e9d5ff;
}

.nx-latency__ms-label {
    margin-left: 6px;
    color: #8d8ca3;
    font-size: 0.8rem;
    font-weight: 700;
}

@media (max-width: 720px) {
    .nx-latency__target {
        grid-template-columns: 1fr;
    }
    .nx-latency__badge {
        margin-left: 0;
    }
    .nx-latency__dc {
        flex-wrap: wrap;
    }
}

.nx-latency__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c026f4;
    box-shadow: 0 0 0 4px rgba(192, 38, 244, 0.18);
}

.nx-latency__dot.is-run {
    animation: nx-lat-pulse 1s ease-in-out infinite;
}

.nx-latency__dot.is-great { background: #20d69a; box-shadow: 0 0 0 4px rgba(32, 214, 154, 0.18); }
.nx-latency__dot.is-good { background: #38bdf8; box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.18); }
.nx-latency__dot.is-ok { background: #f5b52e; box-shadow: 0 0 0 4px rgba(245, 181, 46, 0.18); }
.nx-latency__dot.is-high { background: #f04465; box-shadow: 0 0 0 4px rgba(240, 68, 101, 0.18); }

@keyframes nx-lat-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.65; }
}

.nx-latency__meter {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 8px 0 6px;
}

.nx-latency__ms {
    font-size: clamp(3rem, 8vw, 4.4rem);
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 1;
}

.nx-latency__unit {
    color: #a6a5b8;
    font-weight: 700;
}

.nx-latency__verdict {
    margin: 0 0 18px;
    color: #d7d6e4;
    min-height: 1.4em;
}

.nx-latency__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.nx-latency__stats div {
    padding: 10px 12px;
    background: rgba(18, 18, 28, 0.9);
    border: 1px solid #2b2b40;
    border-radius: 12px;
}

.nx-latency__stats em {
    display: block;
    font-style: normal;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.03em;
}

.nx-latency__stats span {
    color: #8d8ca3;
    font-size: 0.78rem;
    font-weight: 700;
}

.nx-latency__bar {
    height: 6px;
    border-radius: 999px;
    background: #1c1c2a;
    overflow: hidden;
    margin-bottom: 18px;
}

.nx-latency__bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #c026f4, #e879f9);
    transition: width 0.15s ease;
}

.nx-latency__card.is-great .nx-latency__bar span { background: linear-gradient(90deg, #20d69a, #6ee7b7); }
.nx-latency__card.is-good .nx-latency__bar span { background: linear-gradient(90deg, #38bdf8, #7dd3fc); }
.nx-latency__card.is-ok .nx-latency__bar span { background: linear-gradient(90deg, #f5b52e, #fcd34d); }
.nx-latency__card.is-high .nx-latency__bar span { background: linear-gradient(90deg, #f04465, #fb7185); }

.nx-latency__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nx-latency__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid #2b2b40;
    background: #12121c;
    color: #fff !important;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
}

.nx-latency__btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.nx-latency__btn--accent {
    border-color: rgba(192, 38, 244, 0.45);
    background: var(--nx-accent, #c026f4);
}

.nx-latency__guide {
    margin-top: 28px;
    padding-top: 8px;
}

.nx-latency__guide h2 {
    margin: 0 0 12px;
    font-size: 1.15rem;
}

.nx-latency__guide ul {
    margin: 0 0 14px;
    padding-left: 1.1rem;
    color: #d7d6e4;
    line-height: 1.6;
}

.nx-latency__note {
    margin: 0;
    color: #8d8ca3;
    font-size: 0.92rem;
    line-height: 1.5;
}

@media (max-width: 640px) {
    .nx-latency__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
