/* ============================================================
   latency-checker.css — SkyServer Latency Checker tool page
   Accent: brand blue (#4169E1), same family as the DNS tool.
   Font: Outfit (primary), JetBrains Mono (numbers)
============================================================ */

/* ---------- PAGE VARS ---------- */
.lat-body {
    --lat-accent: #4169E1;
    --lat-accent-2: #3154c7;
    --lat-accent-soft: rgba(65, 105, 225, .08);
    --lat-accent-border: rgba(65, 105, 225, .24);
    --lat-excellent: #10b981;
    --lat-good: #22c55e;
    --lat-fair: #f59e0b;
    --lat-poor: #ef4444;
    --lat-text-1: #0f172a;
    --lat-text-2: #334155;
    --lat-text-3: #64748b;
    --lat-border: #e6eaf3;
    --lat-bg: #f8fafc;
    --lat-white: #ffffff;
    --lat-radius: 18px;
    --lat-shadow-md: 0 10px 30px -14px rgba(30, 58, 138, .28);
    --lat-shadow-lg: 0 28px 60px -32px rgba(30, 58, 138, .42);
    background: var(--lat-white);
    color: var(--lat-text-1);
}

.lat-body .container {
    max-width: 1200px;
}

.lat-accent { color: var(--lat-accent); }

.lat-body code,
.lat-meter-value,
.lat-stats dd {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* ---------- HERO ---------- */
.lat-hero {
    position: relative;
    padding: 80px 0 70px;
    text-align: center;
    background:
        radial-gradient(circle at 85% 10%, rgba(65, 105, 225, .16), transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(16, 185, 129, .08), transparent 40%),
        var(--lat-bg);
    overflow: hidden;
}

.lat-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--lat-white);
    border: 1px solid var(--lat-accent-border);
    color: var(--lat-accent);
    font-size: .85rem;
    font-weight: 600;
    flex-wrap: wrap;
    justify-content: center;
}

.lat-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lat-excellent);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .18);
}

.lat-badge-sep { opacity: .5; }

.lat-title {
    margin: 22px 0 16px;
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.02em;
}

.lat-sub {
    max-width: 680px;
    margin: 0 auto;
    color: var(--lat-text-3);
    font-size: 1.1rem;
    line-height: 1.7;
}

.lat-hint {
    margin-top: 22px;
    color: var(--lat-text-3);
    font-size: .92rem;
}

/* ---------- TOOL ---------- */
.lat-tool {
    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: 24px;
    margin-top: 44px;
    text-align: left;
}

.lat-meter {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 34px 28px;
    border-radius: 24px;
    background: linear-gradient(160deg, #1e3a8a, var(--lat-accent));
    color: #fff;
    text-align: center;
    box-shadow: var(--lat-shadow-lg);
}

.lat-meter-label {
    font-size: .9rem;
    font-weight: 600;
    opacity: .8;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.lat-meter-value {
    margin: 10px 0 6px;
    font-size: 4.6rem;
    font-weight: 700;
    line-height: 1;
}

.lat-meter-value small {
    margin-left: 6px;
    font-size: 1.3rem;
    opacity: .75;
}

.lat-meter-rating {
    min-height: 1.5em;
    font-size: .98rem;
    opacity: .9;
}

.lat-meter-rating.is-excellent,
.lat-meter-rating.is-good { color: #a7f3d0; opacity: 1; }
.lat-meter-rating.is-fair { color: #fde68a; opacity: 1; }
.lat-meter-rating.is-poor { color: #fecaca; opacity: 1; }

.lat-progress {
    width: 100%;
    height: 6px;
    margin: 22px 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    overflow: hidden;
}

.lat-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #fff;
    transition: width .25s ease;
}

.lat-start {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 22px;
    border: 0;
    border-radius: 14px;
    background: #fff;
    color: var(--lat-accent-2);
    font: inherit;
    font-size: 1.02rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

.lat-start svg { width: 20px; height: 20px; }

.lat-start:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .45);
}

.lat-start:disabled { opacity: .7; cursor: progress; }

.lat-nodes {
    display: grid;
    gap: 18px;
    align-content: start;
}

.lat-node {
    padding: 22px 24px;
    border: 1px solid var(--lat-border);
    border-radius: var(--lat-radius);
    background: var(--lat-white);
    box-shadow: var(--lat-shadow-md);
    transition: border-color .2s ease;
}

.lat-node.is-active { border-color: var(--lat-accent); }

.lat-node-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.lat-node-city {
    font-size: 1.15rem;
    font-weight: 700;
}

.lat-node-region {
    margin-top: 2px;
    color: var(--lat-text-3);
    font-size: .9rem;
}

.lat-node-status {
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--lat-bg);
    color: var(--lat-text-3);
    font-size: .8rem;
    font-weight: 700;
}

.lat-node-status.is-testing   { background: var(--lat-accent-soft); color: var(--lat-accent); }
.lat-node-status.is-excellent { background: rgba(16, 185, 129, .12); color: #047857; }
.lat-node-status.is-good      { background: rgba(34, 197, 94, .12); color: #15803d; }
.lat-node-status.is-fair      { background: rgba(245, 158, 11, .14); color: #b45309; }
.lat-node-status.is-poor      { background: rgba(239, 68, 68, .12); color: #b91c1c; }

.lat-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 70px;
    margin: 18px 0;
    padding: 8px;
    border-radius: 12px;
    background: var(--lat-bg);
}

.lat-bars span {
    flex: 1;
    min-width: 0;
    border-radius: 4px 4px 2px 2px;
    background: var(--lat-accent);
}

.lat-bars .is-excellent { background: var(--lat-excellent); }
.lat-bars .is-good      { background: var(--lat-good); }
.lat-bars .is-fair      { background: var(--lat-fair); }
.lat-bars .is-poor      { background: var(--lat-poor); }
.lat-bars .is-lost      { background: repeating-linear-gradient(45deg, #fecaca 0 4px, #fff 4px 8px); }

.lat-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.lat-stats div {
    padding: 10px 6px;
    border-radius: 10px;
    background: var(--lat-bg);
    text-align: center;
}

.lat-stats dt {
    color: var(--lat-text-3);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.lat-stats dd {
    margin-top: 4px;
    font-size: .95rem;
    font-weight: 700;
    color: var(--lat-text-1);
    white-space: nowrap;
}

/* ---------- SECTIONS ---------- */
.lat-section { padding: 80px 0; }

.lat-section-alt { background: var(--lat-bg); }

.lat-section-head {
    max-width: 720px;
    margin: 0 auto 44px;
    text-align: center;
}

.lat-kicker {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--lat-accent-soft);
    color: var(--lat-accent);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.lat-section-head h2,
.lat-cta h2 {
    margin: 16px 0 12px;
    font-size: clamp(1.7rem, 3.4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
}

.lat-section-head h2 span { color: var(--lat-accent); }

.lat-section-head p {
    color: var(--lat-text-3);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* steps + cards */
.lat-steps,
.lat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.lat-step,
.lat-card {
    padding: 28px;
    border: 1px solid var(--lat-border);
    border-radius: var(--lat-radius);
    background: var(--lat-white);
}

.lat-step-num {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--lat-accent);
}

.lat-step h3,
.lat-card h3 {
    margin: 12px 0 10px;
    font-size: 1.2rem;
    font-weight: 700;
}

.lat-card h3 { margin-top: 0; }

.lat-step p,
.lat-card p {
    color: var(--lat-text-3);
    line-height: 1.7;
}

/* table */
.lat-table-wrap {
    max-width: 900px;
    margin: 0 auto;
    overflow-x: auto;
    border: 1px solid var(--lat-border);
    border-radius: var(--lat-radius);
    background: var(--lat-white);
}

.lat-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.lat-table th,
.lat-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--lat-border);
    vertical-align: middle;
}

.lat-table tr:last-child td { border-bottom: 0; }

.lat-table th {
    background: var(--lat-bg);
    color: var(--lat-text-3);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.lat-table td { color: var(--lat-text-2); line-height: 1.6; }

.lat-table code { font-weight: 700; color: var(--lat-text-1); white-space: nowrap; }

.lat-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
}

.lat-pill.is-excellent { background: rgba(16, 185, 129, .12); color: #047857; }
.lat-pill.is-good      { background: rgba(34, 197, 94, .12); color: #15803d; }
.lat-pill.is-fair      { background: rgba(245, 158, 11, .14); color: #b45309; }
.lat-pill.is-poor      { background: rgba(239, 68, 68, .12); color: #b91c1c; }

/* CTA */
.lat-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 48px;
    border-radius: 28px;
    background: linear-gradient(135deg, #1e3a8a, var(--lat-accent));
    color: #fff;
    box-shadow: var(--lat-shadow-lg);
}

.lat-cta p {
    max-width: 620px;
    opacity: .88;
    line-height: 1.7;
}

.lat-kicker-light {
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.lat-cta-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.lat-btn {
    display: inline-block;
    padding: 14px 26px;
    border-radius: 12px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: transform .15s ease;
}

.lat-btn:hover { transform: translateY(-2px); }

.lat-btn-light { background: #fff; color: var(--lat-accent-2); }

.lat-btn-ghost { border: 1px solid rgba(255, 255, 255, .5); color: #fff; }

/* FAQ */
.lat-faq {
    max-width: 860px;
    margin: 0 auto;
}

.lat-faq details {
    margin-bottom: 12px;
    padding: 18px 22px;
    border: 1px solid var(--lat-border);
    border-radius: 14px;
    background: var(--lat-white);
}

.lat-faq summary {
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--lat-text-1);
}

.lat-faq details p {
    margin-top: 12px;
    color: var(--lat-text-3);
    line-height: 1.75;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {
    .lat-tool { grid-template-columns: 1fr; }
    .lat-steps,
    .lat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lat-cta { flex-direction: column; align-items: flex-start; }
    .lat-cta-actions { flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 600px) {
    .lat-hero { padding: 56px 0 50px; }
    .lat-section { padding: 56px 0; }
    .lat-steps,
    .lat-grid { grid-template-columns: 1fr; }
    .lat-meter-value { font-size: 3.6rem; }
    .lat-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lat-cta { padding: 32px 24px; }
    .lat-cta-actions { flex-direction: column; width: 100%; }
}
