/* ═══════════════════════════════════════════════════════════════════════════
   1Meeting — design tokens and primitives.

   Dark by default and deliberately so: a meeting window is looked at for hours,
   usually beside a bright document, and it should recede rather than compete. The
   accent is used sparingly — on exactly one primary action per screen — so that when
   something does light up, it means something.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* Surfaces — a near-black base with cool, slightly blue-shifted greys stacked on
       top. Each step up is a surface that sits closer to the viewer. */
    --bg:            #07090f;
    --bg-deep:       #04060a;
    --surface:       #10141f;
    --surface-2:     #171d2c;
    --surface-3:     #1f2739;
    --border:        rgba(148, 165, 214, 0.13);
    --border-strong: rgba(148, 165, 214, 0.24);

    /* Accent — one blue, used for the primary action and live state only. */
    --accent:        #4d8dff;
    --accent-hot:    #6ba0ff;
    --accent-soft:   rgba(77, 141, 255, 0.14);
    --accent-line:   rgba(77, 141, 255, 0.40);

    /* Semantic */
    --ok:            #35d68a;
    --ok-soft:       rgba(53, 214, 138, 0.14);
    --warn:          #ffb43e;
    --warn-soft:     rgba(255, 180, 62, 0.14);
    --danger:        #ff5347;
    --danger-soft:   rgba(255, 83, 71, 0.15);
    --danger-hot:    #ff6b60;

    /* Text */
    --text:          #eaedf6;
    --text-dim:      #98a0ba;
    --text-faint:    #626a85;

    /* Type — the system UI stack, so the app looks native on the OS it is on rather
       than shipping a webfont that arrives late and reflows the whole layout. */
    --font: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont,
            "SF Pro Display", system-ui, Roboto, sans-serif;
    --mono: "Cascadia Code", "SF Mono", ui-monospace, Consolas, monospace;

    --radius:    12px;
    --radius-sm:  8px;
    --radius-lg: 18px;

    --shadow:    0 8px 28px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);

    --ctrl-height: 76px;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: var(--font);
    background:
        radial-gradient(1200px 700px at 50% -10%, #131b30 0%, rgba(19, 27, 48, 0) 62%),
        radial-gradient(900px 600px at 92% 106%, #1a1436 0%, rgba(26, 20, 54, 0) 58%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    /* Chrome is a native window; selecting the UI text is never what someone meant.
       Re-enabled per-element on chat and codes, which people do copy. */
    user-select: none;
}

::selection { background: var(--accent-soft); }

/* ── Scrollbars ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ── Focus ──────────────────────────────────────────────────────────────── */
/* Visible for keyboard users, invisible for mouse users — :focus-visible is the
   whole point, and removing outlines outright breaks keyboard navigation. */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; padding: 0 18px;
    font: inherit; font-size: 0.92rem; font-weight: 600;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.08s var(--ease);
}
.btn:hover  { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
    background: var(--accent); border-color: transparent; color: #04070f;
    box-shadow: 0 4px 16px rgba(77, 141, 255, 0.28);
}
.btn-primary:hover { background: var(--accent-hot); }

.btn-danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn-danger:hover { background: var(--danger-hot); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--text); }

.btn-block { width: 100%; }
.btn-lg { height: 52px; font-size: 1rem; padding: 0 26px; }

/* ── Inputs ─────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }

.label {
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em;
    text-transform: uppercase; color: var(--text-faint);
}

.input, .select {
    height: 44px; padding: 0 13px; width: 100%;
    font: inherit; font-size: 0.94rem; color: var(--text);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    user-select: text;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.input:focus, .select:focus { border-color: var(--accent-line); background: var(--surface-2); }
.input::placeholder { color: var(--text-faint); }

.select {
    appearance: none; cursor: pointer; padding-right: 34px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2398a0ba' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 13px center;
}
.select option { background: var(--surface-2); color: var(--text); }

/* Meeting codes: monospaced, wide-tracked, and big — this gets read off a screen
   and typed by someone on a phone. */
.input-code {
    font-family: var(--mono); font-size: 1.25rem; font-weight: 600;
    letter-spacing: 0.16em; text-align: center; text-transform: uppercase;
    height: 58px;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
    background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.008));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    height: 26px; padding: 0 10px;
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em;
    border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
}
.badge-ok     { background: var(--ok-soft);     border-color: transparent; color: var(--ok); }
.badge-warn   { background: var(--warn-soft);   border-color: transparent; color: var(--warn); }
.badge-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }

/* The live dot — the one thing on screen allowed to move when idle, because
   "is this actually connected?" is the question everyone has. */
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.dot-live { animation: pulse 2.2s var(--ease) infinite; }
@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
    50%      { opacity: 0.65; box-shadow: 0 0 0 4px rgba(53, 214, 138, 0); }
}

/* ── Utility ────────────────────────────────────────────────────────────── */
.row      { display: flex; align-items: center; gap: 10px; }
.col      { display: flex; flex-direction: column; gap: 10px; }
.spacer   { flex: 1; }
.selectable { user-select: text; }
.hidden   { display: none !important; }
.muted    { color: var(--text-dim); }
.faint    { color: var(--text-faint); }
.small    { font-size: 0.82rem; }
.mono     { font-family: var(--mono); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
