/* Copied from Aiva's Cloud/Aiva.Cloud.Web.App/wwwroot/app.css (auth + legal surface) so sign-in looks the same. */
/* ============================================================
   Aiva Code — auth + legal surface
   Overrides the packaged Qui `.auth-*` styles (app.css loads
   after qui-components.css). Everything here is scoped to
   .auth-shell / .legal-shell so it cannot leak app-wide.
   ============================================================ */
.auth-shell,
.legal-shell {
    --acode-bg-canvas: #0b0c0d;
    --acode-bg-surface: #161719;
    --acode-bg-input: #1a1b1d;
    --acode-bg-hover: #202123;
    --acode-border: #2a2c2f;
    --acode-border-strong: #3a3d41;
    --acode-text-primary: #f4f7f5;
    --acode-text-secondary: #9aa0a6;
    --acode-text-muted: #6b7076;
    --acode-accent: #5e6ad2;
    --acode-accent-hover: #4f5bc8;
    --acode-accent-soft: rgba(94, 106, 210, 0.24);
    --acode-danger: #ef4444;
    --acode-brand-green: #6fcf75;
}

body:has(.auth-shell),
body:has(.legal-shell) {
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(94, 106, 210, 0.14), transparent 60%),
        radial-gradient(900px 500px at 85% 110%, rgba(111, 207, 117, 0.08), transparent 55%),
        var(--acode-bg-canvas);
}

/* ---- Shell: flex + safe centering (centers when it fits,
   top-anchors + scrolls when the panel is taller than the viewport) ---- */
.auth-shell {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: safe center;
    min-height: 100vh;
    padding: 40px 20px;
    overflow: auto;
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(94, 106, 210, 0.14), transparent 60%),
        radial-gradient(900px 500px at 85% 110%, rgba(111, 207, 117, 0.08), transparent 55%),
        var(--acode-bg-canvas);
}

/* ---- Panel: 400px card ---- */
.auth-shell .auth-panel {
    box-sizing: border-box;
    width: min(400px, calc(100vw - 40px));
    margin: 0 auto;
    gap: 20px;
    padding: 32px;
    background: var(--acode-bg-surface);
    border: 1px solid var(--acode-border);
    border-radius: 12px;
    box-shadow:
        0 1px 0 0 rgba(255, 255, 255, 0.03) inset,
        0 24px 60px rgba(0, 0, 0, 0.45);
    text-align: center;
}

.auth-shell .auth-logo {
    width: auto;
    height: auto;
    margin: 0;
    align-self: center;
}
.auth-shell .auth-logo img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
}
.auth-shell .auth-logo img.auth-logo__image {
    display: block;
    width: min(100%, 260px);
    height: auto;
    border-radius: 0;
    object-fit: contain;
}
/* Green brand chip — scoped to the auth logo so the admin-shell
   workspace chip is unaffected. */
.auth-shell .auth-logo .shell-workspace-button__mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--acode-brand-green);
    color: #0b0c0d;
    font-size: 22px;
    font-weight: 760;
    line-height: 1;
    letter-spacing: -0.02em;
    box-shadow: 0 6px 18px rgba(111, 207, 117, 0.28);
}

.auth-shell .auth-panel__copy {
    gap: 6px;
}
.auth-shell .auth-panel__copy h1 {
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.01em;
    line-height: 1.3;
}
.auth-shell .auth-panel__description {
    max-width: none;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--acode-text-secondary);
}
.auth-shell .auth-panel__description strong {
    color: var(--acode-text-primary);
    font-weight: 620;
}

/* ---- Forms + inputs ---- */
.auth-shell .auth-form {
    gap: 6px;
    margin-top: 0;
    text-align: left;
}
.auth-shell .auth-label {
    display: block;
    font-size: 13px;
    font-weight: 560;
    color: var(--acode-text-secondary);
    margin-top: 10px;
}
.auth-shell .auth-form > .auth-label:first-child {
    margin-top: 0;
}
.auth-shell .auth-input {
    box-sizing: border-box;
    font-size: 16px;
    min-height: 40px;
    height: auto;
    padding: 9px 12px;
    border: 1px solid var(--acode-border-strong);
    border-radius: 6px;
    background: var(--acode-bg-input);
    color: var(--acode-text-primary);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.auth-shell .auth-input::placeholder { color: var(--acode-text-muted); }
.auth-shell .auth-input:hover {
    border-color: color-mix(in srgb, var(--acode-accent) 40%, var(--acode-border-strong));
}
.auth-shell .auth-input:focus {
    border-color: var(--acode-accent);
    box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.18);
    background: color-mix(in srgb, var(--acode-bg-input) 88%, var(--acode-accent) 12%);
}

/* ---- Buttons (rounded, not pill) ---- */
.auth-shell .auth-button {
    position: relative;
    min-height: 44px;
    height: auto;
    margin-top: 18px;
    border: 1px solid var(--acode-border-strong);
    border-radius: 8px;
    background: var(--acode-bg-hover);
    color: var(--acode-text-primary);
    font-size: 15px;
    font-weight: 620;
    line-height: 1;
    gap: 8px;
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.06s ease;
}
.auth-shell .auth-button:active { transform: translateY(0.5px); }
.auth-shell .auth-button:not(.auth-button--primary):hover,
.auth-shell .auth-button:not(.auth-button--primary):focus-visible {
    background: color-mix(in srgb, var(--acode-bg-hover) 80%, #fff 6%);
    border-color: var(--acode-border-strong);
    color: var(--acode-text-primary);
}
.auth-shell .auth-button--primary {
    color: #fff;
    background: var(--acode-accent);
    border-color: var(--acode-accent-soft);
}
.auth-shell .auth-button--primary:hover,
.auth-shell .auth-button--primary:focus-visible {
    background: var(--acode-accent-hover);
    color: #fff;
}
.auth-shell .auth-button--primary:focus-visible {
    outline: 2px solid rgba(94, 106, 210, 0.5);
    outline-offset: 2px;
}

/* ---- Busy loader ---- */
.auth-shell .auth-button__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
}
.auth-shell .auth-button__loader {
    color: #fff;
}
.auth-shell .auth-button.is-busy {
    cursor: default;
    background: var(--acode-accent-hover);
    pointer-events: none;
}
.auth-shell .auth-button:not(.is-busy) .auth-button__loader { display: none; }
/* Busy: hide the label and absolutely-center the loader in the button, so it
   never depends on the button's flex / line-height context (which was dropping
   it into the bottom-left corner). */
.auth-shell .auth-button.is-busy .auth-button__text { visibility: hidden; }
.auth-shell .auth-button.is-busy .auth-button__loader {
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
}

/* ---- Error / status banner ---- */
.auth-shell .auth-form__error {
    margin: 0;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
    color: #ffb4ac;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid color-mix(in srgb, var(--acode-danger) 40%, transparent);
    border-radius: 6px;
}
.auth-shell .auth-form__error--status {
    color: var(--acode-text-secondary);
    background: color-mix(in srgb, var(--acode-bg-hover) 70%, transparent);
    border-color: var(--acode-border);
}

/* ---- Divider ("or") ---- */
.auth-shell .auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    color: var(--acode-text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.auth-shell .auth-divider::before,
.auth-shell .auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--acode-border);
}

/* ---- Footer + under-panel legal line ---- */
.auth-shell .auth-panel__footer {
    font-size: 13px;
    color: var(--acode-text-secondary);
}
.auth-shell .auth-panel__footer a {
    color: var(--acode-accent);
    text-decoration: none;
    font-weight: 560;
}
.auth-shell .auth-panel__footer a:hover { text-decoration: underline; }
.auth-shell .auth-panel__footer .auth-panel__footer-form { display: inline; }
.auth-shell .auth-panel__footer .auth-link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    color: var(--acode-accent);
    font-weight: 560;
}
.auth-shell .auth-panel__footer .auth-link-button:hover { text-decoration: underline; }

.auth-shell > .auth-legal {
    width: min(400px, calc(100vw - 40px));
    margin: 18px auto 0;
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    color: var(--acode-text-muted);
}
.auth-shell > .auth-legal a { color: var(--acode-text-secondary); }

