/* ════════════════════════════════════════════════════════════════
   site/layout.css — app shell & shared content primitives
   ----------------------------------------------------------------
   Migrated out of Components/Layout/DashboardLayout.razor.css and
   Components/Layout/OnboardingLayout.razor.css. These layouts exposed
   their primitives to page content via ::deep; now that the CSS is
   global those selectors are rewritten as plain descendant selectors
   under .content / .ob-card (the layout's own root elements), which
   reach exactly the same page content.

   Design tokens live on .shell here (re-skinned for light mode by
   wwwroot/app.css). Only DashboardLayout + OnboardingLayout moved:
   MainLayout, NavMenu, DashboardSidebar, ImpersonationBanner and
   ReconnectModal keep their scoped .razor.css because their selectors
   (.sidebar, .top-row, #blazor-error-ui, .navbar-*, .imp-*, the
   #components-reconnect-modal kit) are either component-internal or
   collide with each other by name and are only safe when scoped.

   SCSS-READY: becomes _layout.scss.
   ════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════
   Dashboard shell (from DashboardLayout)
   ════════════════════════════════════════════════════════════════ */

.shell {
    --bg:        #131517;
    --bg-side:   #0E1011;
    --surface:   #1A1D1F;
    --surface-2: #23272A;
    --map-land:  #24292C;
    --line:      rgba(255, 255, 255, 0.09);
    --line-soft: rgba(255, 255, 255, 0.05);
    --text:      #EAEEEF;
    --muted:     #8A9296;
    --faint:     #5C6468;
    --accent:    #2DD4BF;
    --accent-2:  #5EEAD9;
    --accent-blue: #4D85F5;
    --accent-soft: rgba(45, 212, 191, 0.14);
    --accent-line: rgba(45, 212, 191, 0.42);

    --good:   #2DD4BF;
    --warn:   #FFB454;
    --bad:    #FF6B6B;
    --crit:   #B98AFF;

    /* Square, angular cards — no rounding */
    --radius:    0px;
    --radius-sm: 0px;
    /* Single typeface across the whole UI — same as the nav bar (Inter) */
    --font-display: "Inter", "Segoe UI", system-ui, sans-serif;
    --font-body:    "Inter", "Segoe UI", system-ui, sans-serif;

    display: flex;
    min-height: 100vh;
    background:
        radial-gradient(1100px 500px at 85% -10%, rgba(45, 212, 191, 0.06), transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.45;
}

/* ─── Main column ─────────────────────────────────────────────── */

.content {
    flex: 1;
    min-width: 0;
    padding: 34px 38px 56px;
    display: flex;
    flex-direction: column;
    gap: 34px;
    max-width: 1480px;
    margin-inline: auto;
    width: 100%;
}

/* ─── Page header (exposed to page content) ───────────────────── */

.content .page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.content .eyebrow {
    margin: 0 0 4px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.content .page-head h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--accent-blue);
}

.content .head-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 13px;
}

.content .btn-ghost {
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: 600 13px var(--font-body);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.content .btn-ghost:hover {
    border-color: var(--accent-line);
    background: var(--surface-2);
    transform: translateY(-1px);
}

/* ─── Section scaffolding (exposed to page content) ───────────── */

.content .section { display: flex; flex-direction: column; gap: 16px; }

.content .section-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.content .section-head h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.005em;
}

.content .section-sub { font-size: 13px; color: var(--faint); }
.content .section-head.tight { margin-bottom: 14px; }

.content .panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.content .panel.pad { padding: 22px 24px; }

/* ─── Responsive (shell / content) ────────────────────────────── */

@media (max-width: 900px) {
    .shell { flex-direction: column; }
    .content { padding: 22px 18px 40px; }
}

/* ─── Accessibility ───────────────────────────────────────────── */

.content :is(a, button):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .content * { transition-duration: 0.01ms !important; }
}

/* ════════════════════════════════════════════════════════════════
   Onboarding return-leg layout (from OnboardingLayout)
   Standalone (outside .shell), palette declared locally to match the
   dashboard tokens.
   ════════════════════════════════════════════════════════════════ */

.ob-shell {
    --bg:        #131517;
    --surface:   #1A1D1F;
    --line:      rgba(255, 255, 255, 0.09);
    --line-soft: rgba(255, 255, 255, 0.05);
    --text:      #EAEEEF;
    --muted:     #8A9296;
    --accent:    #2DD4BF;
    --accent-2:  #5EEAD9;
    --accent-line: rgba(45, 212, 191, 0.42);
    --accent-soft: rgba(45, 212, 191, 0.14);
    --bad:       #FF6B6B;

    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background:
        radial-gradient(1100px 520px at 85% -12%, rgba(45, 212, 191, 0.08), transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.ob-card {
    width: min(520px, 100%);
    padding: 36px 38px 32px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.85);
}

.ob-brand { height: 26px; width: auto; margin-bottom: 26px; }

/* Shared content primitives used by Connected.razor. */

.ob-card .ob-title {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

.ob-card .ob-text {
    margin: 0 auto 22px;
    max-width: 42ch;
    color: var(--muted);
}

.ob-card .ob-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
}
.ob-card .ob-icon-good {
    color: var(--accent);
    border: 2px solid var(--accent-line);
    background: var(--accent-soft);
}
.ob-card .ob-icon-bad {
    color: var(--bad);
    border: 2px solid rgba(255, 107, 107, 0.42);
    background: rgba(255, 107, 107, 0.12);
}

.ob-card .ob-spinner {
    width: 46px;
    height: 46px;
    margin: 4px auto 20px;
    border: 3px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: ob-spin 0.8s linear infinite;
}
@keyframes ob-spin { to { transform: rotate(360deg); } }

.ob-card .ob-bar {
    height: 6px;
    width: 100%;
    margin-top: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
}
.ob-card .ob-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .4s ease;
}

.ob-card .ob-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 0 22px;
}
.ob-card .ob-metric-value {
    font-size: 30px;
    font-weight: 700;
    color: var(--accent-2);
}
.ob-card .ob-metric-label {
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.ob-card .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font: 600 13px "Inter", "Segoe UI", system-ui, sans-serif;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, filter .18s ease;
}
.ob-card .btn:hover { border-color: var(--accent-line); }
.ob-card .btn-primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #04201D;
}
.ob-card .btn-primary:hover { filter: brightness(1.08); }

@media (prefers-reduced-motion: reduce) {
    .ob-card .ob-spinner { animation-duration: 2s; }
}
