/* ==========================================================================
   BZ Bot Hosting — base design system
   Dark, glassmorphic, gradient-driven. Tokens first, components after.
   ========================================================================== */

:root {
    --bg: #070b1c;
    --bg-soft: #0b1128;
    --panel: rgba(20, 28, 58, 0.62);
    --panel-solid: #121a38;
    --line: rgba(139, 158, 255, 0.16);
    --line-strong: rgba(139, 158, 255, 0.34);

    --text: #eef2ff;
    --muted: #9aa6d4;
    --muted-dim: #6d78a6;

    --brand: #6c5ce7;
    --brand-2: #00d2ff;
    --brand-3: #ff5cb8;
    --ok: #2fd4a7;
    --warn: #ffb340;
    --err: #ff5f6d;

    --grad-brand: linear-gradient(135deg, #6c5ce7 0%, #00d2ff 100%);
    --grad-hot: linear-gradient(135deg, #ff5cb8 0%, #ffb340 100%);
    --grad-panel: linear-gradient(160deg, rgba(108, 92, 231, .16), rgba(0, 210, 255, .06));

    --radius: 18px;
    --radius-sm: 12px;
    --radius-lg: 28px;
    --shadow: 0 24px 60px -20px rgba(4, 8, 24, .85);
    --shadow-glow: 0 0 0 1px rgba(139, 158, 255, .14), 0 18px 50px -22px rgba(108, 92, 231, .8);

    --font: "Hind Siliguri", "Noto Sans Bengali", "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono: "JetBrains Mono", "Fira Code", ui-monospace, "Cascadia Code", Consolas, monospace;

    --ease: cubic-bezier(.22, .68, 0, 1);
    --sidebar-w: 264px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }

a { color: var(--brand-2); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: #7ee8ff; }

img, svg { max-width: 100%; height: auto; }

.muted { color: var(--muted); }
.dim { color: var(--muted-dim); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.hidden { display: none !important; }

.container { width: min(1200px, 92vw); margin-inline: auto; }
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 3rem 0; }

.skip-link {
    position: absolute; left: -999px; top: 0; z-index: 999;
    background: var(--brand); color: #fff; padding: .75rem 1.25rem; border-radius: 0 0 12px 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
    outline: 2px solid var(--brand-2);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ---------------------------------------------------------- ambient orbs */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-orbs span {
    position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5;
    animation: orbFloat 22s var(--ease) infinite alternate;
}
.bg-orbs span:nth-child(1) {
    width: 46vw; height: 46vw; left: -12vw; top: -10vw;
    background: radial-gradient(circle, #6c5ce7 0%, transparent 68%);
}
.bg-orbs span:nth-child(2) {
    width: 38vw; height: 38vw; right: -10vw; top: 18vh;
    background: radial-gradient(circle, #00d2ff 0%, transparent 68%);
    animation-delay: -7s;
}
.bg-orbs span:nth-child(3) {
    width: 32vw; height: 32vw; left: 32vw; bottom: -14vw;
    background: radial-gradient(circle, #ff5cb8 0%, transparent 70%);
    animation-delay: -13s;
}
@keyframes orbFloat {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(4vw, -3vh, 0) scale(1.12); }
    100% { transform: translate3d(-3vw, 4vh, 0) scale(.94); }
}

/* ---------------------------------------------------------------- buttons */
.btn {
    --btn-bg: transparent;
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .78rem 1.5rem; border: 1px solid transparent; border-radius: 999px;
    font: inherit; font-weight: 600; color: var(--text); background: var(--btn-bg);
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), opacity .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn-sm { padding: .5rem 1rem; font-size: .875rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: 0 14px 34px -14px rgba(108, 92, 231, .9); }
.btn-primary:hover { box-shadow: 0 20px 44px -14px rgba(0, 210, 255, .8); color: #fff; }
.btn-hot { background: var(--grad-hot); color: #1a1030; }
.btn-ghost { border-color: var(--line-strong); background: rgba(139, 158, 255, .06); }
.btn-ghost:hover { background: rgba(139, 158, 255, .14); color: var(--text); }
.btn-danger { background: rgba(255, 95, 109, .14); border-color: rgba(255, 95, 109, .42); color: #ffb9be; }
.btn-danger:hover { background: rgba(255, 95, 109, .24); color: #fff; }
.btn-ok { background: rgba(47, 212, 167, .14); border-color: rgba(47, 212, 167, .4); color: #9df3dc; }

/* ------------------------------------------------------------ cards/panels */
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}
.glass { backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); }
.card-hover { transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease); }
.card-hover:hover { transform: translateY(-6px); border-color: var(--line-strong); box-shadow: var(--shadow-glow); }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.row-between { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }

.eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .35rem .9rem; border-radius: 999px;
    border: 1px solid var(--line-strong); background: rgba(139, 158, 255, .08);
    font-size: .8rem; font-weight: 600; letter-spacing: .04em; color: #c9d2ff;
}
.gradient-text {
    background: var(--grad-brand); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}

/* ------------------------------------------------------------- badges/pills */
.badge {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .22rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 700;
    letter-spacing: .03em; border: 1px solid transparent;
}
.badge-ok { background: rgba(47, 212, 167, .14); color: #7fecd0; border-color: rgba(47, 212, 167, .35); }
.badge-warn { background: rgba(255, 179, 64, .14); color: #ffd39a; border-color: rgba(255, 179, 64, .38); }
.badge-err { background: rgba(255, 95, 109, .14); color: #ffb0b6; border-color: rgba(255, 95, 109, .38); }
.badge-info { background: rgba(0, 210, 255, .12); color: #97e7ff; border-color: rgba(0, 210, 255, .35); }
.badge-mute { background: rgba(139, 158, 255, .1); color: var(--muted); border-color: var(--line); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(47, 212, 167, .18); animation: pulse 2s infinite; }
.dot-err { background: var(--err); box-shadow: 0 0 0 4px rgba(255, 95, 109, .18); }
.dot-mute { background: var(--muted-dim); }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(47, 212, 167, 0); } }

/* -------------------------------------------------------------------- forms */
.field { margin-bottom: 1.1rem; }
.field label, .label { display: block; margin-bottom: .4rem; font-size: .9rem; font-weight: 600; color: #cdd5ff; }
.hint { font-size: .8rem; color: var(--muted-dim); margin-top: .35rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="tel"], input[type="search"], select, textarea {
    width: 100%; padding: .82rem 1rem;
    background: rgba(8, 12, 30, .72);
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    color: var(--text); font: inherit;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: rgba(0, 210, 255, .6);
    box-shadow: 0 0 0 4px rgba(0, 210, 255, .12);
    background: rgba(8, 12, 30, .92);
}
input::placeholder, textarea::placeholder { color: var(--muted-dim); }
input[aria-invalid="true"] { border-color: rgba(255, 95, 109, .7); }
textarea { min-height: 120px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%;
    background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 2.5rem; }

.checkbox { display: flex; gap: .65rem; align-items: flex-start; font-size: .9rem; color: var(--muted); }
.checkbox input { width: 18px; height: 18px; margin-top: .2rem; accent-color: var(--brand); flex: 0 0 auto; }
.field-error { color: #ffb0b6; font-size: .82rem; margin-top: .35rem; display: block; }

.input-group { display: flex; gap: .5rem; }
.input-group input, .input-group select { flex: 1; }

/* password strength meter */
.meter { height: 6px; border-radius: 999px; background: rgba(139, 158, 255, .14); overflow: hidden; margin-top: .5rem; }
.meter > i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .3s var(--ease), background .3s; }

/* --------------------------------------------------------------- flash msgs */
.flash-stack { display: grid; gap: .6rem; margin: 0 auto 1.25rem; width: min(1200px, 92vw); }
.shell-public .flash-stack { padding-top: 6.5rem; }
.flash {
    display: flex; gap: .75rem; align-items: flex-start;
    padding: .85rem 1.1rem; border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong); background: var(--panel);
    backdrop-filter: blur(14px); animation: flashIn .4s var(--ease);
}
.flash p { margin: 0; flex: 1; }
.flash-x { background: none; border: 0; color: var(--muted); font-size: 1.3rem; cursor: pointer; line-height: 1; }
.flash-success { border-color: rgba(47, 212, 167, .4); }
.flash-error { border-color: rgba(255, 95, 109, .45); }
.flash-warning { border-color: rgba(255, 179, 64, .45); }
@keyframes flashIn { from { opacity: 0; transform: translateY(-10px); } }

/* ------------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 620px; }
table.data th, table.data td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { background: rgba(139, 158, 255, .06); font-size: .78rem; letter-spacing: .06em;
    text-transform: uppercase; color: var(--muted); font-weight: 700; }
table.data tbody tr { transition: background .2s; }
table.data tbody tr:hover { background: rgba(139, 158, 255, .05); }
table.data tbody tr:last-child td { border-bottom: 0; }
.empty-state { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.empty-state .emoji { font-size: 2.6rem; display: block; margin-bottom: .5rem; }

/* code / log output */
.code-block, .log-box {
    font-family: var(--mono); font-size: .82rem; line-height: 1.6;
    background: #05081a; border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 1rem; overflow: auto; white-space: pre-wrap; word-break: break-word;
    max-height: 420px; color: #cfe3ff; margin: 0;
}
.log-line { display: flex; gap: .75rem; padding: .18rem 0; }
.log-line time { color: var(--muted-dim); flex: 0 0 auto; }
.log-info { color: #cfe3ff; }
.log-success { color: #8ff0d5; }
.log-warning { color: #ffd39a; }
.log-error { color: #ffb0b6; }
.log-system { color: #b8a6ff; }

/* --------------------------------------------------------------- pagination */
.pager { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; margin-top: 1.5rem; }
.pager a, .pager span {
    min-width: 40px; padding: .45rem .7rem; text-align: center; border-radius: 10px;
    border: 1px solid var(--line); color: var(--muted); font-size: .88rem;
}
.pager a:hover { border-color: var(--line-strong); color: var(--text); }
.pager .is-active { background: var(--grad-brand); color: #fff; border-color: transparent; }

/* --------------------------------------------------------------- progress */
.bar { height: 10px; border-radius: 999px; background: rgba(139, 158, 255, .12); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--grad-brand);
    transition: width .6s var(--ease); }
.bar.warn > i { background: var(--grad-hot); }
.bar.err > i { background: linear-gradient(135deg, #ff5f6d, #ffb340); }

.stat { display: grid; gap: .3rem; }
.stat .k { font-size: .8rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.stat .v { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.stat .s { font-size: .82rem; color: var(--muted-dim); }

/* ----------------------------------------------------------- public site nav */
.site-nav {
    position: fixed; inset: 0 0 auto; z-index: 90;
    padding: 1rem 0; transition: background .35s var(--ease), padding .35s var(--ease), box-shadow .35s;
}
.site-nav.is-stuck {
    background: rgba(7, 11, 28, .82); backdrop-filter: blur(18px);
    padding: .55rem 0; box-shadow: 0 12px 40px -24px #000;
    border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-size: 1.1rem; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
    background: var(--grad-brand); font-size: 1.2rem;
    box-shadow: 0 10px 24px -10px rgba(108, 92, 231, .9);
}
.brand-text { font-weight: 500; letter-spacing: -.01em; }
.brand-text strong { font-weight: 800; }
.brand-sm { font-size: 1rem; }

.nav-links { display: flex; gap: 1.5rem; margin-inline: auto; font-size: .95rem; }
.nav-links a { color: var(--muted); position: relative; }
.nav-links a::after {
    content: ''; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
    background: var(--grad-brand); border-radius: 2px; transition: width .25s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-actions { display: flex; gap: .6rem; align-items: center; }

.nav-toggle {
    display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: .4rem;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .25s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ------------------------------------------------------------------- footer */
.site-foot { margin-top: 6rem; border-top: 1px solid var(--line); background: rgba(8, 12, 30, .6); padding: 3rem 0 1.5rem; }
.foot-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.foot-grid h4 { font-size: .9rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.foot-grid a { display: block; color: var(--muted); font-size: .92rem; padding: .15rem 0; }
.foot-grid a:hover { color: var(--brand-2); }
.foot-bottom { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line);
    display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted-dim); }

/* ------------------------------------------------------------- auth screens */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 7rem 1rem 3rem; }
.auth-card { width: min(460px, 100%); }
.auth-card .brand { margin-bottom: 1.25rem; }
.auth-alt { text-align: center; margin-top: 1.25rem; font-size: .92rem; color: var(--muted); }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--muted-dim); font-size: .8rem; margin: 1.25rem 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.btn-google { background: #fff; color: #1f2440; border-color: #fff; }
.btn-google:hover { color: #1f2440; background: #f1f3ff; }

/* ------------------------------------------------------------------ toast */
.toast-host { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; display: grid; gap: .5rem; }
.toast {
    padding: .8rem 1.1rem; border-radius: 12px; background: var(--panel-solid);
    border: 1px solid var(--line-strong); box-shadow: var(--shadow); max-width: 340px;
    animation: toastIn .3s var(--ease);
}
.toast.ok { border-color: rgba(47, 212, 167, .5); }
.toast.err { border-color: rgba(255, 95, 109, .5); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } }

/* -------------------------------------------------------------- reveal anim */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

.spinner {
    width: 16px; height: 16px; border-radius: 50%; display: inline-block;
    border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
        transition-duration: .001ms !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
    .nav-links { display: none; }
    .nav-toggle { display: flex; }
    .site-nav.is-open .nav-links {
        display: grid; position: absolute; inset: 100% .5rem auto; padding: 1rem 1.25rem;
        background: rgba(10, 15, 36, .97); border: 1px solid var(--line); border-radius: var(--radius);
        gap: .5rem; backdrop-filter: blur(18px);
    }
    .nav-actions .btn { padding: .6rem 1.1rem; font-size: .9rem; }
}

