/* =========================================================================
   dxn.pw — design system
   A dark, glassy, neon-gradient aesthetic shared by the public and admin UIs.
   ========================================================================= */

:root {
    --bg:          #07070c;
    --bg-2:        #0d0d18;
    --surface:     rgba(255, 255, 255, 0.04);
    --surface-2:   rgba(255, 255, 255, 0.07);
    --border:      rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text:        #eef0f6;
    --muted:       #9aa0b4;
    --faint:       #6b7185;

    --violet:      #8b5cf6;
    --indigo:      #6366f1;
    --cyan:        #22d3ee;
    --emerald:     #34d399;
    --rose:        #fb7185;
    --amber:       #fbbf24;

    --grad: linear-gradient(120deg, #8b5cf6 0%, #6366f1 40%, #22d3ee 100%);
    --grad-soft: linear-gradient(120deg, rgba(139,92,246,.18), rgba(34,211,238,.12));

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.65);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: "SF Mono", "JetBrains Mono", "Fira Code", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

/* Animated background mesh shared by all pages. */
body::before {
    content: "";
    position: fixed;
    inset: -30vmax;
    z-index: -2;
    background:
        radial-gradient(40vmax 40vmax at 18% 12%, rgba(139, 92, 246, 0.22), transparent 60%),
        radial-gradient(38vmax 38vmax at 85% 18%, rgba(34, 211, 238, 0.18), transparent 60%),
        radial-gradient(45vmax 45vmax at 60% 95%, rgba(99, 102, 241, 0.18), transparent 60%);
    filter: blur(8px);
    animation: drift 24s ease-in-out infinite alternate;
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(circle at 50% 30%, black, transparent 80%);
}

@keyframes drift {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(2vmax, -2vmax, 0) scale(1.08); }
}

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

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---- gradient text + brand --------------------------------------------- */
.gradient-text {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: 1.25rem;
}
.brand .dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--grad);
    box-shadow: 0 0 18px rgba(139, 92, 246, 0.8);
}

/* ---- buttons ----------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text);
    font: inherit; font-weight: 600; font-size: 0.92rem;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
    text-decoration: none;
}
.btn:hover { transform: translateY(-1px); border-color: var(--border-strong); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: var(--grad);
    border: none;
    color: #fff;
    box-shadow: 0 10px 30px -8px rgba(99, 102, 241, 0.6);
}
.btn-primary:hover { box-shadow: 0 14px 36px -8px rgba(99, 102, 241, 0.8); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--rose); border-color: rgba(251, 113, 133, 0.4); }
.btn-danger:hover { background: rgba(251, 113, 133, 0.12); }
.btn-sm { padding: 7px 12px; font-size: 0.82rem; }

/* ---- cards & glass ----------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.card-pad { padding: 28px; }

/* ---- forms ------------------------------------------------------------- */
label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
input[type="text"], input[type="url"], select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}
.field { margin-bottom: 16px; }
.hint { color: var(--faint); font-size: 0.78rem; margin-top: 6px; }
.checkbox { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; color: var(--text); }
.checkbox input { width: auto; }

/* ---- tables ------------------------------------------------------------ */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); font-weight: 700; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: var(--surface-2); }
td.mono, .mono { font-family: var(--mono); }

/* ---- chips / badges ---------------------------------------------------- */
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    font-size: 0.74rem; font-weight: 700; letter-spacing: .02em;
    border: 1px solid var(--border);
}
.chip-on  { color: var(--emerald); background: rgba(52, 211, 153, 0.12); border-color: rgba(52,211,153,.3); }
.chip-off { color: var(--faint);   background: rgba(255,255,255,0.04); }
.chip-code { color: var(--cyan); background: rgba(34,211,238,.1); border-color: rgba(34,211,238,.3); }
.chip-404 { color: var(--rose); background: rgba(251,113,133,.12); border-color: rgba(251,113,133,.3); }
.chip-405 { color: var(--amber); background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.3); }

.slug-pill {
    font-family: var(--mono);
    font-weight: 700;
    background: var(--grad-soft);
    border: 1px solid var(--border-strong);
    padding: 4px 10px; border-radius: 8px;
    color: #fff;
}

/* ---- flash messages ---------------------------------------------------- */
.flash { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; font-weight: 600; font-size: .92rem; border: 1px solid; }
.flash-success { color: var(--emerald); background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.3); }
.flash-error   { color: var(--rose);    background: rgba(251,113,133,.1); border-color: rgba(251,113,133,.3); }

/* ---- admin chrome ------------------------------------------------------ */
.topbar {
    position: sticky; top: 0; z-index: 10;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    background: rgba(7, 7, 12, 0.7);
    border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.topbar .who { font-size: .82rem; color: var(--muted); }
.topbar .who b { color: var(--text); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 26px 0; }
.stat { padding: 20px 22px; }
.stat .n { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.stat .l { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }

.section-title { font-size: 1.05rem; font-weight: 700; margin: 30px 0 14px; letter-spacing: -0.01em; }

/* ---- hero (landing) ---------------------------------------------------- */
.hero { text-align: center; padding: 110px 0 70px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 20px; font-weight: 850; }
.hero p.lead { font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: var(--muted); max-width: 620px; margin: 0 auto 34px; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: 999px;
    border: 1px solid var(--border-strong); background: var(--surface);
    font-size: .78rem; color: var(--muted); margin-bottom: 26px; font-weight: 600;
}
.eyebrow .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }

.demo-url {
    font-family: var(--mono);
    display: inline-block;
    padding: 14px 22px;
    border-radius: 12px;
    background: rgba(0,0,0,.35);
    border: 1px solid var(--border-strong);
    font-size: 1.1rem;
}
.demo-url .host { color: var(--muted); }
.demo-url .slug { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 70px 0; }
.feature { padding: 26px; }
.feature .ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--border); margin-bottom: 16px; font-size: 1.3rem; }
.feature h3 { margin: 0 0 8px; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); font-size: .92rem; }

.footer { text-align: center; color: var(--faint); padding: 50px 0; font-size: .85rem; border-top: 1px solid var(--border); margin-top: 40px; }

/* ---- centered standalone pages (404, auth error) ----------------------- */
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.center-screen .code { font-size: clamp(5rem, 18vw, 9rem); font-weight: 850; letter-spacing: -0.04em; line-height: 1; }

.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: var(--surface-2); border: 1px solid var(--border-strong);
    padding: 12px 18px; border-radius: 12px; backdrop-filter: blur(12px);
    opacity: 0; transition: all .25s ease; pointer-events: none; font-weight: 600; font-size: .9rem;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }

@media (max-width: 720px) {
    .hide-sm { display: none; }
    .card-pad { padding: 20px; }
}
