/* ============================================================
   Hostra — dark, glass, minimal technical SaaS
   ============================================================ */

:root {
    --bg:            #070b14;
    --bg-deep:       #04070e;
    --panel:         rgba(255, 255, 255, .045);
    --panel-strong:  rgba(255, 255, 255, .07);
    --border:        rgba(148, 178, 255, .13);
    --border-strong: rgba(148, 178, 255, .24);

    --text:          #eaf1fb;
    --text-soft:     #b9c6dd;
    --muted:         #8494b1;
    --faint:         #5d6b86;

    --accent:        #3b82f6;
    --accent-2:      #60a5fa;
    --accent-soft:   rgba(59, 130, 246, .16);
    --accent-glow:   rgba(59, 130, 246, .35);

    --ok:            #34d399;
    --ok-soft:       rgba(52, 211, 153, .13);
    --warn:          #fbbf24;
    --warn-soft:     rgba(251, 191, 36, .13);
    --danger:        #f87171;
    --danger-soft:   rgba(248, 113, 113, .13);
    --pending:       #93a4bd;
    --pending-soft:  rgba(147, 164, 189, .12);

    --radius:        18px;
    --radius-sm:     12px;
    --shadow-lg:     0 24px 60px -24px rgba(0, 0, 0, .75);
    --font:          "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
                     "Helvetica Neue", Arial, sans-serif;
    --mono:          "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code",
                     Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    line-height: 1.55;
    overflow-x: hidden;
}

/* Ambient gradient field behind everything */
.aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(720px 420px at 12% -8%, rgba(59, 130, 246, .22), transparent 62%),
        radial-gradient(640px 420px at 92% 4%, rgba(99, 102, 241, .16), transparent 60%),
        radial-gradient(900px 700px at 50% 108%, rgba(14, 116, 144, .10), transparent 68%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}
.aurora::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 178, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 178, 255, .045) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 25%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 25%, transparent 78%);
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ----------------------------- Header ----------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    background: rgba(7, 11, 20, .62);
    border-bottom: 1px solid var(--border);
}
.topbar__inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: .8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    color: inherit;
}
.brand img { display: block; filter: drop-shadow(0 4px 10px rgba(59, 130, 246, .45)); }
.brand__name { font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; }
.brand__pill {
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent-2);
    background: var(--accent-soft);
    border: 1px solid rgba(96, 165, 250, .35);
    padding: .15rem .45rem;
    border-radius: 999px;
}
.topbar__nav { display: flex; align-items: center; gap: 1.1rem; }
.topbar__badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .76rem;
    font-weight: 500;
    color: var(--muted);
}
.topbar__badge svg { color: var(--ok); }
.topbar__link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-soft);
    text-decoration: none;
    padding: .35rem .6rem;
    border-radius: 9px;
    border: 1px solid transparent;
    transition: color .18s, border-color .18s, background .18s;
}
.topbar__link:hover {
    color: var(--text);
    border-color: var(--border);
    background: var(--panel);
}

/* ------------------------------ Page ------------------------------ */
.page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 3.6rem 1.5rem 4.5rem;
}

.hero { text-align: center; margin-bottom: 2.4rem; }
.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--accent-2);
    background: var(--accent-soft);
    border: 1px solid rgba(96, 165, 250, .3);
    padding: .35rem .8rem;
    border-radius: 999px;
    margin-bottom: 1.15rem;
}
.hero__eyebrow svg { color: var(--accent-2); }
.hero__title {
    margin: 0 0 .8rem;
    font-size: clamp(2.1rem, 5.6vw, 3.4rem);
    line-height: 1.06;
    font-weight: 800;
    letter-spacing: -.035em;
}
.hero__title span {
    background: linear-gradient(96deg, var(--accent-2), #a5b4fc 55%, #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero__subtitle {
    max-width: 640px;
    margin: 0 auto;
    color: var(--text-soft);
    font-size: clamp(.96rem, 1.6vw, 1.06rem);
}

/* ------------------------------ Glass ----------------------------- */
.glass {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.glass::before {
    content: "";
    position: relative;
    display: block;
    height: 0;
    border-top: 1px solid rgba(255, 255, 255, .07);
    border-radius: var(--radius) var(--radius) 0 0;
    pointer-events: none;
}

.panel { padding: 1.4rem; }

/* ---------------------------- Tool tabs ---------------------------- */
.tools {
    display: flex;
    gap: .4rem;
    padding: .35rem;
    margin-bottom: 1rem;
    background: rgba(4, 7, 14, .55);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tools::-webkit-scrollbar { display: none; }

.tool {
    flex: 1 1 0;
    min-width: max-content;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-family: var(--font);
    font-size: .85rem;
    font-weight: 600;
    padding: .6rem .85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: color .18s, background .18s, box-shadow .18s;
}
.tool svg { flex: 0 0 auto; }
.tool:hover { color: var(--text-soft); background: var(--panel-strong); }
.tool--active {
    color: #fff;
    background: linear-gradient(180deg, rgba(96, 165, 250, .22), rgba(37, 86, 232, .28));
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .4), 0 6px 16px -10px var(--accent-glow);
}
.tool--active svg { color: var(--accent-2); }

/* ---------------------------- Form ----------------------------- */
.check-form__field {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: rgba(4, 7, 14, .55);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    padding: .45rem .5rem .45rem .95rem;
    transition: border-color .2s, box-shadow .2s;
}
.check-form__field:focus-within {
    border-color: rgba(96, 165, 250, .6);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.check-form__field.is-invalid {
    border-color: rgba(248, 113, 113, .65);
    box-shadow: 0 0 0 4px var(--danger-soft);
}
.check-form__icon { color: var(--faint); flex: 0 0 auto; display: flex; }
.check-form__input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font-family: var(--font);
    font-size: clamp(1rem, 2vw, 1.18rem);
    font-weight: 500;
    padding: .85rem .25rem;
    outline: none;
}
.check-form__input::placeholder { color: var(--faint); font-weight: 400; }

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    border: 0;
    border-radius: 11px;
    font-family: var(--font);
    font-size: .95rem;
    font-weight: 650;
    letter-spacing: .005em;
    padding: .8rem 1.35rem;
    cursor: pointer;
    transition: transform .16s, box-shadow .2s, filter .2s;
}
.btn--primary {
    color: #fff;
    background: linear-gradient(180deg, #4d8df8, #2456e8);
    box-shadow: 0 8px 22px -10px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.btn--primary:hover { filter: brightness(1.08); box-shadow: 0 12px 28px -10px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn--primary:active { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; opacity: .85; }
.btn__spinner {
    width: 15px; height: 15px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    animation: spin .7s linear infinite;
    display: none;
}
.btn.is-loading .btn__label { display: none; }
.btn.is-loading .btn__spinner { display: block; }

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

.check-form__hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: .85rem;
    min-height: 1.5rem;
}
.form-message { font-size: .83rem; color: var(--muted); }
.form-message.is-error { color: var(--danger); font-weight: 500; }
.check-form__examples { display: inline-flex; align-items: center; gap: .4rem; color: var(--faint); font-size: .8rem; }
.chip {
    font-family: var(--mono);
    font-size: .76rem;
    font-weight: 500;
    color: var(--text-soft);
    background: var(--panel-strong);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .28rem .65rem;
    cursor: pointer;
    transition: color .16s, border-color .16s, background .16s;
}
.chip:hover { color: var(--text); border-color: rgba(96, 165, 250, .45); background: var(--accent-soft); }

/* ---------------------------- Summary ----------------------------- */
.summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .85rem;
    margin: 1.6rem 0;
}
.stat {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .9rem 1.05rem;
    animation: rise .38s ease both;
}
.stat__icon {
    display: grid;
    place-items: center;
    width: 34px; height: 34px;
    border-radius: 10px;
    color: var(--accent-2);
    background: var(--accent-soft);
    border: 1px solid rgba(96, 165, 250, .22);
    flex: 0 0 auto;
}
.stat__body { display: flex; flex-direction: column; min-width: 0; }
.stat__label { font-size: .72rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.stat__value { font-family: var(--mono); font-size: 1.22rem; font-weight: 600; letter-spacing: -.01em; }
.stat--progress .stat__body { gap: .5rem; }

.progress {
    height: 7px;
    border-radius: 999px;
    background: rgba(4, 7, 14, .8);
    border: 1px solid var(--border);
    overflow: hidden;
}
.progress__bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2456e8, #60a5fa);
    transition: width .45s cubic-bezier(.22, 1, .36, 1);
}

/* ---------------------------- Results ----------------------------- */
.results { display: flex; flex-direction: column; gap: 1rem; }

.empty {
    text-align: center;
    padding: 3.2rem 1.5rem;
    animation: rise .4s ease both;
}
.empty__icon {
    display: inline-grid;
    place-items: center;
    width: 62px; height: 62px;
    margin-bottom: 1rem;
    border-radius: 18px;
    color: var(--accent-2);
    background: var(--accent-soft);
    border: 1px solid rgba(96, 165, 250, .22);
}
.empty--error .empty__icon { color: var(--danger); background: var(--danger-soft); border-color: rgba(248, 113, 113, .25); }
.empty__title { margin: 0 0 .4rem; font-size: 1.2rem; font-weight: 700; letter-spacing: -.015em; }
.empty__text { margin: 0 auto; max-width: 460px; color: var(--text-soft); font-size: .94rem; }
.empty__hint { margin: .75rem auto 0; max-width: 520px; color: var(--faint); font-size: .82rem; }

.table-wrap { overflow: hidden; animation: rise .4s ease both; }
.table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.table-head__title { margin: 0; font-size: 1rem; font-weight: 650; letter-spacing: -.01em; }
.table-head__title span {
    margin-left: .55rem;
    font-family: var(--mono);
    font-size: .8rem;
    font-weight: 500;
    color: var(--accent-2);
    background: var(--accent-soft);
    border: 1px solid rgba(96, 165, 250, .25);
    border-radius: 7px;
    padding: .1rem .45rem;
    vertical-align: 1px;
}
.table-head__link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .8rem;
    font-weight: 550;
    color: var(--text-soft);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: .35rem .65rem;
    transition: color .16s, border-color .16s;
}
.table-head__link:hover { color: var(--text); border-color: rgba(96, 165, 250, .45); }

.table-scroll { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    min-width: 760px;
}
.table thead th {
    text-align: left;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--faint);
    padding: .7rem 1.1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(4, 7, 14, .35);
    white-space: nowrap;
}
.table tbody td { padding: .8rem 1.1rem; border-bottom: 1px solid rgba(148, 178, 255, .075); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .18s; }
.table tbody tr:hover { background: rgba(148, 178, 255, .045); }
.table tbody tr.row--flash { animation: flash .9s ease; }

@keyframes flash {
    0% { background: rgba(96, 165, 250, .16); }
    100% { background: transparent; }
}

/* Location cell */
.loc { display: flex; align-items: center; gap: .65rem; white-space: nowrap; }
.loc__flag {
    width: 26px; height: 19px;
    border-radius: 3px;
    object-fit: cover;
    background: rgba(148, 178, 255, .1);
    border: 1px solid rgba(148, 178, 255, .18);
    flex: 0 0 auto;
}
.loc__code {
    display: inline-grid;
    place-items: center;
    width: 26px; height: 19px;
    border-radius: 3px;
    font-family: var(--mono);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--muted);
    background: rgba(148, 178, 255, .08);
    border: 1px solid rgba(148, 178, 255, .16);
    flex: 0 0 auto;
    text-transform: uppercase;
}
.loc__text { display: flex; flex-direction: column; min-width: 0; }
.loc__city { font-weight: 600; letter-spacing: -.005em; overflow: hidden; text-overflow: ellipsis; }
.loc__country { font-size: .78rem; color: var(--faint); }

/* Node cell */
.node { display: flex; flex-direction: column; gap: .12rem; }
.node__name { font-family: var(--mono); font-size: .8rem; font-weight: 500; color: var(--text-soft); }
.node__ip { font-family: var(--mono); font-size: .72rem; color: var(--faint); }

/* Status pill */
.status {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .78rem;
    font-weight: 600;
    border-radius: 999px;
    padding: .28rem .7rem;
    border: 1px solid transparent;
    white-space: nowrap;
}
.status svg { flex: 0 0 auto; }
.status--success { color: var(--ok); background: var(--ok-soft); border-color: rgba(52, 211, 153, .28); }
.status--partial { color: var(--warn); background: var(--warn-soft); border-color: rgba(251, 191, 36, .28); }
.status--timeout { color: #fb923c; background: rgba(251, 146, 60, .12); border-color: rgba(251, 146, 60, .28); }
.status--failed  { color: var(--danger); background: var(--danger-soft); border-color: rgba(248, 113, 113, .28); }
.status--pending { color: var(--pending); background: var(--pending-soft); border-color: rgba(147, 164, 189, .2); }

.dot-spinner {
    width: 12px; height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(147, 164, 189, .28);
    border-top-color: var(--pending);
    animation: spin .7s linear infinite;
    flex: 0 0 auto;
}

/* Latency cell */
.latency { font-family: var(--mono); font-size: .94rem; font-weight: 600; white-space: nowrap; }
.latency b { font-size: 1rem; }
.latency span { color: var(--faint); font-weight: 400; font-size: .76rem; margin-left: .15rem; }
.latency--na { color: var(--faint); font-weight: 500; }
.latency__bar {
    margin-top: .35rem;
    height: 4px;
    width: clamp(48px, 9vw, 88px);
    border-radius: 999px;
    background: rgba(4, 7, 14, .8);
    overflow: hidden;
}
.latency__bar i {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2456e8, #60a5fa);
    transition: width .5s cubic-bezier(.22, 1, .36, 1);
}

.details { color: var(--muted); font-size: .8rem; max-width: 280px; }

/* ----------------------------- Footer ----------------------------- */
.footer {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1.6rem 1.5rem 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    flex-wrap: wrap;
    color: var(--faint);
    font-size: .8rem;
    border-top: 1px solid var(--border);
}
.footer a { color: var(--text-soft); text-decoration: none; border-bottom: 1px solid rgba(148, 178, 255, .25); }
.footer a:hover { color: var(--text); }

@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------- Responsive -------------------------- */
@media (max-width: 900px) {
    .summary { grid-template-columns: repeat(2, 1fr); }
    .stat--progress { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
    .topbar__badge { display: none; }
    .page { padding-top: 2.4rem; }
    .panel { padding: 1rem; }
    .check-form__field { flex-wrap: wrap; padding: .5rem .55rem .55rem .85rem; }
    .check-form__input { padding: .65rem .25rem; flex: 1 1 100%; }
    .btn { width: 100%; }
    .check-form__hint { flex-direction: column; align-items: flex-start; gap: .5rem; }
    .check-form__examples { flex-wrap: wrap; }
    .details { max-width: none; }
}
@media (max-width: 520px) {
    .summary { grid-template-columns: 1fr; }
    .stat--progress { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
