:root {
    --bg: #08111f;
    --bg-soft: #0e1a2e;
    --card: #122033;
    --line: rgba(148, 197, 255, 0.14);
    --text: #e7eef8;
    --muted: #93a4bb;
    --cyan: #3ee0c9;
    --cyan-dark: #17b39d;
    --ok: #4ade80;
    --bad: #fb7185;
    --warn: #fbbf24;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at 12% -10%, rgba(62, 224, 201, 0.16), transparent 32%),
        radial-gradient(circle at 90% 0%, rgba(56, 189, 248, 0.12), transparent 28%),
        var(--bg);
    color: var(--text);
    font-family: "Vazirmatn", sans-serif;
}

a {
    color: var(--cyan);
    text-decoration: none;
}

.app-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding-bottom: 64px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 0 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 800;
}

.brand-mark {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--cyan);
    box-shadow: 0 0 0 6px rgba(62, 224, 201, 0.16);
}

.nav,
.hero-actions,
.actions,
.split,
.inline-form {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav a,
.link-button {
    color: var(--muted);
    background: none;
    border: 0;
    font: inherit;
    cursor: pointer;
}

.page {
    display: grid;
    gap: 20px;
}

.page-head,
.site-card-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.page-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.page-head-actions form {
    margin: 0;
}

h1,
h2 {
    margin: 0 0 8px;
}

.muted,
.lead,
.eyebrow {
    color: var(--muted);
}

.lead {
    max-width: 640px;
    line-height: 1.9;
}

.eyebrow {
    letter-spacing: 0.08em;
    font-size: 13px;
}

.hero {
    padding: 48px 0 12px;
}

.hero h1 {
    font-size: clamp(32px, 6vw, 56px);
    line-height: 1.35;
}

.hero-steps,
.stats,
.site-grid {
    display: grid;
    gap: 14px;
}

.hero-steps {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 36px;
}

.hero-steps article,
.stats article,
.card,
.site-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%), var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.hero-steps article,
.stats article,
.card,
.empty {
    padding: 20px;
}

.hero-steps strong {
    display: block;
    color: var(--cyan);
    margin-bottom: 8px;
}

.stats {
    grid-template-columns: repeat(3, 1fr);
}

.stats span,
.site-card dt {
    color: var(--muted);
    font-size: 13px;
}

.stats strong {
    display: block;
    margin-top: 8px;
    font-size: 32px;
}

.ok { color: var(--ok); }
.bad { color: var(--bad); }

.auth-card,
.form-card {
    width: min(520px, 100%);
    margin: 24px auto 0;
}

.stack {
    display: grid;
    gap: 14px;
}

.stack > label,
.field {
    display: grid;
    gap: 8px;
    font-size: 14px;
}

.field > span {
    color: var(--muted);
}

input,
select,
button {
    font: inherit;
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--bg-soft);
    color: var(--text);
    border-radius: 14px;
    padding: 12px 14px;
}

.check {
    grid-template-columns: auto 1fr;
    align-items: center;
}

.check input {
    width: auto;
}

.btn,
.btn-small,
.btn-ghost,
.btn-danger {
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    background: var(--cyan);
    color: #04221d;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
}

.btn-small {
    padding: 8px 12px;
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
}

.btn-danger {
    background: #3b1520;
    color: #fecdd3;
}

.form-card .btn,
.form-card .btn-danger,
.form-card a.btn {
    width: 100%;
    color: #04221d;
    text-decoration: none;
}

.form-card .btn-danger {
    color: #fecdd3;
}

.flash {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
}

.flash-success { background: rgba(74, 222, 128, 0.12); }
.flash-error { background: rgba(251, 113, 133, 0.12); }
.flash-warning { background: rgba(251, 191, 36, 0.12); }

.center { text-align: center; }

.site-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.site-card {
    padding: 18px;
    color: inherit;
    display: grid;
    gap: 10px;
}

.site-card h2 {
    font-size: 20px;
}

.url {
    color: var(--muted);
    overflow-wrap: anywhere;
    margin: 0;
}

.site-card dl {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 0;
}

.site-card dd {
    margin: 4px 0 0;
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}

.pill-up { background: rgba(74, 222, 128, 0.16); color: var(--ok); }
.pill-down { background: rgba(251, 113, 133, 0.16); color: var(--bad); }
.pill-unknown { background: rgba(147, 164, 187, 0.16); color: var(--muted); }
.pill.large { padding: 8px 14px; font-size: 14px; }

.back {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--muted);
}

.live-hint {
    margin-right: 8px;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 700;
}

tr.is-fresh td {
    background: rgba(62, 224, 201, 0.08);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: right;
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.steps {
    color: var(--muted);
    line-height: 2;
}

code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 8px;
}

.webhook-card {
    display: grid;
    gap: 12px;
}

.webhook-url-row {
    align-items: stretch;
}

.webhook-url-row input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
}

.webhook-url-row .btn,
.webhook-url-row .btn-ghost {
    white-space: nowrap;
    min-width: 110px;
    align-items: center;
}

.webhook-actions {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex: 0 0 auto;
}

.webhook-actions .inline-form {
    margin: 0;
}

.webhook-actions .btn,
.webhook-actions .btn-ghost {
    height: 100%;
}

.sample-box {
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: #091321;
}

.sample-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--line);
}

.sample-btn {
    border: 1px solid var(--line);
    background: #122033;
    color: var(--text);
    font-weight: 800;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    min-width: 108px;
}

.sample-btn:hover {
    border-color: var(--cyan);
}

.sample-btn.is-on {
    background: var(--cyan);
    border-color: var(--cyan);
    color: #04221d;
}

.sample-toolbar .btn {
    margin-right: auto;
    min-width: 96px;
}

.sample-code {
    display: none;
    margin: 0;
    overflow-x: auto;
    padding: 18px 20px 20px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.8;
    white-space: pre;
    color: #dcecff;
}

.sample-code.is-on {
    display: block;
}

.empty {
    text-align: center;
}

@media (max-width: 720px) {
    .topbar,
    .page-head,
    .actions,
    .split,
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-steps,
    .stats {
        grid-template-columns: 1fr;
    }

    .sample-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .sample-toolbar .btn,
    .sample-btn {
        width: 100%;
        margin: 0;
    }

    .nav {
        flex-wrap: wrap;
    }
}
