/* Everything MudBlazor does not cover: the two statically-rendered auth pages
   and Blazor's reconnect modal. Deliberately small — the panel's look comes
   from the MudBlazor theme in MainLayout, not from here. */

:root {
    --bg: #12151a;
    --surface: #1a1f27;
    --border: #2b323d;
    --text: #e6e9ee;
    --muted: #9aa4b2;
    --primary: #4dabf7;
    --error: #ff6b6b;
    --warn: #ffa94d;
}

/* ---- statically-rendered auth pages ---- */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 26rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem;
}

.auth-title { margin: 0; font-size: 1.6rem; font-weight: 600; letter-spacing: -0.01em; }
.auth-sub { margin: 0.15rem 0 1.5rem; color: var(--muted); font-size: 0.85rem; }
.auth-note { margin: 0 0 1rem; color: var(--warn); font-size: 0.85rem; line-height: 1.45; }

.auth-error {
    margin: 0 0 1rem;
    padding: 0.6rem 0.75rem;
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.35);
    border-radius: 6px;
    color: var(--error);
    font-size: 0.85rem;
}

.auth-label {
    display: block;
    margin: 0.9rem 0 0.35rem;
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.auth-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.7rem;
    background: #0f1216;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.95rem;
}

.auth-input:focus { outline: none; border-color: var(--primary); }

.auth-button {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.65rem;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: #0b0e12;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.auth-button:hover { filter: brightness(1.08); }

.auth-link {
    display: block;
    margin-top: 1.25rem;
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
    text-decoration: none;
}

.auth-link:hover { color: var(--primary); }

.validation-message { display: block; margin-top: 0.3rem; color: var(--error); font-size: 0.8rem; }

/* ---- reconnect modal ----
   Blazor toggles this element's display itself; it is hidden until a circuit
   drops. Styled rather than left to the framework default because an operator
   on an Iranian connection will see it often, and "the page stopped working"
   is a support call. */

.reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    background: rgba(6, 8, 11, 0.75);
}

#components-reconnect-modal[style*="display: block"],
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex !important;
}

.reconnect-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.reconnect-title { margin: 0 0 0.4rem; font-weight: 600; }
.reconnect-body { margin: 0; color: var(--muted); font-size: 0.85rem; }
.reconnect-reload { display: none; margin-top: 0.9rem; color: var(--primary); font-size: 0.85rem; }

/* Only offer a reload once reconnecting has actually given up. */
.components-reconnect-failed .reconnect-reload,
.components-reconnect-rejected .reconnect-reload { display: inline-block; }

/* ---- shared ---- */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Command output and apply errors. Monospace and scrollable rather than wrapped:
   a traceroute or an nft dump is column-aligned, and reflowing it destroys the
   alignment that makes it readable. */
.cmd-output {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    margin: 0;
    padding: 0.6rem 0.8rem;
    background: var(--mud-palette-background-grey);
    border-radius: 4px;
    max-height: 24rem;
    overflow: auto;
    white-space: pre;
}

/* Boosted-vs-direct chart. Both series share one scale on purpose — see
   PathChart.razor — so the colours are the only thing distinguishing them and
   they have to stay legible in both themes. */
.path-chart svg {
    width: 100%;
    height: 140px;
    display: block;
    overflow: visible;
}
.pc-grid   { stroke: var(--mud-palette-lines-default); stroke-width: 1; }
.pc-tick   { fill: var(--mud-palette-text-secondary); font-size: 9px; }
.pc-direct  { fill: none; stroke: var(--mud-palette-text-secondary); stroke-width: 1.5;
              stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.pc-boosted { fill: none; stroke: var(--mud-palette-primary); stroke-width: 2;
              vector-effect: non-scaling-stroke; }
.pc-legend { font-size: 0.78rem; margin-top: 0.4rem; }
.pc-key { display: inline-block; width: 14px; height: 3px; margin: 0 4px 0 10px;
          vertical-align: middle; }
.pc-key-boosted { background: var(--mud-palette-primary); }
.pc-key-direct  { background: var(--mud-palette-text-secondary); }
.pc-unit { font-size: 0.7em; opacity: 0.7; margin-left: 2px; }
.pc-missing { display: block; margin-top: 0.2rem; color: var(--mud-palette-warning); }

/* A rendered relay config, shown so an operator can copy it onto another VPS.
   Scrolls in its own box rather than stretching the page: it is a few hundred
   lines and the surrounding table has to stay usable. */
.config-dump { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
               font-size: 0.75rem; line-height: 1.35; max-height: 26rem; overflow: auto;
               background: var(--mud-palette-background-grey); padding: 0.75rem;
               border-radius: 4px; white-space: pre; }
