/* LCARS — the Star Trek: TNG panel language Picard is built on.
   Black field, Sternbach palette, heavy rounded bars, elbows, condensed uppercase type.
   Layout: fixed left rail of stacked buttons, a top header bar, content to the right,
   and a bottom-right elbow that closes the frame. */

:root {
    --lcars-orange: #ff9c00;
    --lcars-gold: #ffcc66;
    --lcars-salmon: #cc6666;
    --lcars-pink: #cc99cc;
    --lcars-purple: #9999cc;
    --lcars-blue: #99ccff;
    --lcars-ice: #aaddff;
    --lcars-lilac: #cc99ff;
    --lcars-tan: #ffcc99;
    --lcars-black: #000000;
    --lcars-rail: 168px;
}

html, body {
    background: var(--lcars-black);
    color: var(--lcars-tan);
    font-family: "Antonio", "Oswald", "Helvetica Neue Condensed", "Arial Narrow", Arial, sans-serif;
    letter-spacing: 0.02em;
}

/* the MudBlazor surface must not paint its own light background over the black field */
.mud-layout, .mud-main-content { background: var(--lcars-black) !important; }

a { color: var(--lcars-blue); text-decoration: none; }
a:hover, a:focus, a:visited { text-decoration: none; }

/* keep browsers' default chrome from showing through the black field */
* { scrollbar-color: var(--lcars-purple) #050505; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #050505; }
::-webkit-scrollbar-thumb { background: var(--lcars-purple); border-radius: 6px; }
::selection { background: var(--lcars-orange); color: #000; }
body { margin: 0; overflow-x: hidden; overflow-y: auto; }
.lcars-panel::-webkit-scrollbar { width: 8px; }
.lcars-panel { overflow-y: auto; }
a:hover { color: var(--lcars-ice); }

/* ---------------------------------------------------------------- shell */
.lcars {
    display: grid;
    grid-template-columns: var(--lcars-rail) 1fr;
    grid-template-rows: 56px 1fr 26px;
    grid-template-areas:
        "rail head"
        "rail body"
        "rail foot";
    min-height: 100dvh;
    gap: 0 10px;
    padding: 8px 10px 8px 0;
    box-sizing: border-box;
    background: var(--lcars-black);
}

.lcars-rail {
    grid-area: rail;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 0;
}

/* everything in the rail reads as one right-aligned stack, like a panel legend */
.lcars-rail .lcars-bar { justify-content: flex-end; }
.lcars-rail .lcars-btn { min-height: 44px; }

.lcars-head {
    grid-area: head;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lcars-body {
    grid-area: body;
    min-height: 0;
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 10px;
}

.lcars-foot {
    grid-area: foot;
    display: flex;
    gap: 8px;
    align-items: stretch;
}

/* ---------------------------------------------------------------- bars */
.lcars-bar {
    background: var(--lcars-orange);
    color: #000;
    border-radius: 0 22px 22px 0;
    padding: 6px 18px;
    display: flex;
    align-items: center;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    min-height: 34px;
}

.lcars-bar.right { border-radius: 22px 0 0 22px; justify-content: space-between; }
.lcars-bar.slim { min-height: 22px; font-size: .8rem; }

.lcars-bar.gold { background: var(--lcars-gold); }
.lcars-bar.salmon { background: var(--lcars-salmon); }
.lcars-bar.pink { background: var(--lcars-pink); }
.lcars-bar.purple { background: var(--lcars-purple); }
.lcars-bar.blue { background: var(--lcars-blue); }
.lcars-bar.lilac { background: var(--lcars-lilac); }
.lcars-bar.ice { background: var(--lcars-ice); }

/* rail buttons: capped on the right, hugging the left edge */
.lcars-btn {
    appearance: none;
    border: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 16px;
    min-height: 46px;
    border-radius: 0 26px 26px 0;
    background: var(--lcars-salmon);
    color: #000;
    font: inherit;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: right;
}
.lcars-btn:hover { filter: brightness(1.15); }
.lcars-btn:disabled { opacity: .45; cursor: default; }
.lcars-btn.blue { background: var(--lcars-blue); }
.lcars-btn.purple { background: var(--lcars-purple); }
.lcars-btn.gold { background: var(--lcars-gold); }
.lcars-btn.pink { background: var(--lcars-pink); }
.lcars-btn.lilac { background: var(--lcars-lilac); }
.lcars-btn.orange { background: var(--lcars-orange); }

/* the elbow: a bar that curves down into the frame */
.lcars-elbow {
    background: var(--lcars-orange);
    border-radius: 0 0 0 28px;
    min-height: 26px;
}

/* ---------------------------------------------------------------- panels */
/* the elbow: the vertical accent line needs a horizontal stub at its head or the frame
   reads as a floating line rather than LCARS geometry */
.lcars-panel::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 0;
    width: 42px;
    height: 14px;
    background: var(--lcars-orange);
    border-radius: 0 0 26px 0;
}

.lcars-panel { position: relative; padding-top: 22px; }

.lcars-panel {
    background: #050505;
    border-left: 6px solid var(--lcars-orange);
    border-radius: 0 18px 18px 0;
    padding: 14px 18px;
    overflow: auto;
    min-height: 0;
}

.lcars-panel.plain { border-left-color: var(--lcars-blue); }

.lcars-title {
    font-size: clamp(1.9rem, 4.4vw, 3rem);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--lcars-orange);
    margin: 0 0 .2em;
}

.lcars-sub {
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: .8rem;
    color: var(--lcars-blue);
    margin: 0 0 1.4em;
}

.lcars-text { color: var(--lcars-tan); font-size: 1.05rem; line-height: 1.45; }
.lcars-muted { color: var(--lcars-purple); }

.lcars-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lcars-list li {
    background: #0b0b0b;
    border-left: 4px solid var(--lcars-purple);
    border-radius: 0 12px 12px 0;
    padding: 10px 14px;
    color: var(--lcars-tan);
}
.lcars-list strong { color: var(--lcars-gold); text-transform: uppercase; letter-spacing: .08em; }

/* ---------------------------------------------------------------- chat */
.lcars-msg {
    background: #080808;
    border-radius: 0 14px 14px 0;
    border-left: 5px solid var(--lcars-purple);
    padding: 10px 14px;
    margin-bottom: 10px;
}
.lcars-msg.you { border-left-color: var(--lcars-orange); }

.lcars-msg .who {
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: .72rem;
    color: var(--lcars-blue);
    display: block;
    margin-bottom: 4px;
}

.lcars-input {
    width: 100%;
    background: #0b0b0b;
    color: var(--lcars-tan);
    border: 0;
    border-left: 5px solid var(--lcars-gold);
    border-radius: 0 14px 14px 0;
    padding: 12px 14px;
    font: inherit;
    font-size: 1.05rem;
    resize: vertical;
    min-height: 62px;
    box-sizing: border-box;
}
.lcars-input::placeholder { color: #6b6b8a; text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; }
.lcars-input:focus { outline: 2px solid var(--lcars-orange); outline-offset: 0; }

.lcars-round {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    background: var(--lcars-orange);
    color: #000;
    font: inherit;
    font-size: 1.5rem;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}
.lcars-round.rec { background: var(--lcars-salmon); animation: lcars-pulse 1s infinite; }
.lcars-round:disabled { opacity: .4; cursor: default; }
@keyframes lcars-pulse { 50% { filter: brightness(1.45); } }

.lcars-alert {
    border-left: 5px solid var(--lcars-salmon);
    background: #140505;
    color: #ffb3b3;
    border-radius: 0 12px 12px 0;
    padding: 8px 14px;
    margin-bottom: 10px;
    font-size: .95rem;
}
.lcars-alert.info { border-left-color: var(--lcars-blue); background: #050a14; color: var(--lcars-ice); }

/* selects and Mud controls on the LCARS field */
.lcars .mud-input-control, .lcars .mud-select { color: var(--lcars-tan); }
.lcars .mud-input-outlined { background: #0b0b0b; }
.lcars .mud-input-outlined-border { border-color: var(--lcars-purple) !important; }
.lcars .mud-input-label { color: var(--lcars-blue) !important; letter-spacing: .12em; text-transform: uppercase; font-size: .75rem; }

/* ---------------------------------------------------------------- Identity pages */
/* /Account/Login and friends still use the template's Bootstrap markup; dress it as LCARS
   so the front door matches the panels behind it. */
.card, .border-top, form > .row { border: 0 !important; background: transparent !important; }
.container .card, main .card {
    background: #050505 !important;
    border-left: 6px solid var(--lcars-orange) !important;
    border-radius: 0 18px 18px 0 !important;
    padding: 18px 22px;
}
h1, h2, h3, .card-title { color: var(--lcars-orange); text-transform: uppercase; letter-spacing: .08em; font-weight: 500; }
.form-control, .form-check-input {
    background: #0b0b0b; color: var(--lcars-tan); border: 0;
    border-left: 4px solid var(--lcars-gold); border-radius: 0 10px 10px 0;
}
.form-control:focus { background: #0b0b0b; color: var(--lcars-tan); box-shadow: 0 0 0 2px var(--lcars-orange); }
label, .form-label { color: var(--lcars-blue); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; }
.btn-primary, button[type="submit"] {
    background: var(--lcars-gold); color: #000; border: 0; border-radius: 22px;
    text-transform: uppercase; letter-spacing: .12em; font-weight: 600; padding: 10px 22px;
}
.btn-primary:hover, button[type="submit"]:hover { background: var(--lcars-orange); color: #000; }
.btn-link, a { color: var(--lcars-blue); }
.card-body { padding: 0; }
main { background: var(--lcars-black); min-height: 100vh; padding: 28px 22px; }
main > .row, main .col-md-4, main .col-lg-5, main .col-xl-4 { max-width: 46rem; margin: 0 auto; }

/* ---------------------------------------------------------------- phones */
@media (max-width: 760px) {
    /* A fixed side rail on a 390px screen costs a quarter of the width and the page cannot
       scroll past it, so the rail becomes a horizontal strip pinned above the content. */
    .lcars {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr auto;
        grid-template-areas:
            "rail"
            "head"
            "body"
            "foot";
        gap: 6px;
        padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
        min-height: 100dvh;
    }

    .lcars-rail {
        flex-direction: row;
        align-items: stretch;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .lcars-rail::-webkit-scrollbar { display: none; }
    .lcars-rail > * { flex: 0 0 auto; }
    .lcars-rail .lcars-bar,
    .lcars-rail .lcars-btn {
        border-radius: 22px;
        justify-content: center;
        min-height: 34px;
        padding: 6px 14px;
        font-size: .78rem;
        letter-spacing: .08em;
    }
    .lcars-rail > div[style*="flex:1"] { display: none; }

    .lcars-head { flex-wrap: wrap; gap: 6px; }
    .lcars-head .lcars-bar { min-height: 30px; font-size: .82rem; padding: 4px 12px; }
    .lcars-head .lcars-bar.right { min-width: 0 !important; flex: 0 0 auto; }

    .lcars-body { display: block; }
    .lcars-title { font-size: 1.55rem; }
    .lcars-sub { font-size: .7rem; letter-spacing: .16em; }
    .lcars-text { font-size: .98rem; }
    .lcars-panel {
        padding: 14px 12px 12px;
        max-height: none !important;
        min-height: 0 !important;
        overflow: visible;
    }
    .lcars-foot { margin-top: 8px; }
    .lcars-elbow { width: 90px !important; }

    /* 16px stops iOS zooming the page when a field takes focus */
    .lcars-input, .form-control, textarea, input[type="text"], input[type="email"], input[type="password"] {
        font-size: 16px !important;
    }
    .lcars-round { width: 52px; height: 52px; font-size: 1.15rem; }
    .lcars-msg { padding: 8px 12px; font-size: .95rem; }
    main { padding: 14px 10px; }
}
