.bgs-login-screen {
    background: radial-gradient(ellipse at 0 0, rgba(124, 58, 237, .12), transparent 65%), var(--bgs-bg);
}
.bgs-login-screen .bgs-shell { min-height: 100vh; min-height: 100dvh; }
.bgs-login-screen .bgs-main {
    display: grid;
    place-items: center;
    padding: max(1.5rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
}
.bgs-auth { width: min(100%, 420px); margin: auto; }
.bgs-auth-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.8rem; font-size: 2rem; font-weight: 800; letter-spacing: -.06em; }
.bgs-auth-brand img { width: 52px; height: 52px; border-radius: 15px; }
.bgs-auth-brand-dot { color: #8b5cf6; }
.bgs-auth-kicker { color: var(--bgs-muted); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .65rem; }
.bgs-auth-intro h1 { font-size: clamp(2.5rem, 9vw, 3.3rem); font-weight: 800; line-height: 1.04; letter-spacing: -.055em; }
.bgs-auth-intro > p:last-child { color: var(--bgs-muted); margin: 1rem 0 1.75rem; max-width: 30ch; }
.bgs-auth-panel { padding: 1.5rem; border: 1px solid var(--bgs-border); border-radius: 1.5rem; background: var(--bgs-surface); box-shadow: 0 16px 50px var(--bgs-shadow); }
.bgs-auth-panel a { color: #6d28d9; text-underline-offset: 3px; }
[data-bs-theme="dark"] .bgs-auth-panel a { color: #c4b5fd; }
.bgs-auth .form-label { font-weight: 600; font-size: .85rem; }
.bgs-auth .form-control { min-height: 52px; border-radius: .85rem; font-size: 16px; background-color: var(--bgs-bg); color: var(--bgs-text); border-color: var(--bgs-border); }
.bgs-auth .form-control:focus { border-color: #8b5cf6; box-shadow: 0 0 0 .2rem rgba(139, 92, 246, .2); }
.bgs-auth-password { position: relative; }
.bgs-auth-password .form-control { padding-right: 3.4rem; }
.bgs-auth-reveal { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; display: grid; place-items: center; color: var(--bgs-muted); border: 0; background: transparent; border-radius: .65rem; }
.bgs-auth-reveal[hidden], .bgs-auth-reveal [hidden] { display: none; }
.bgs-auth-remember { font-size: .8rem; min-height: 44px; display: flex; align-items: center; gap: .6rem; padding-left: 0; }
.bgs-auth-remember .form-check-input { float: none; margin: 0; flex-shrink: 0; width: 1.2rem; height: 1.2rem; }
.bgs-auth .bgs-auth-submit { display: flex; justify-content: center; align-items: center; gap: .8rem; min-height: 54px; border-radius: .9rem; background: #6d28d9; color: #fff; font-weight: 700; border-color: #6d28d9; }
.bgs-auth .bgs-auth-submit:hover { background: #5b21b6; }
.bgs-auth .bgs-auth-submit:disabled { opacity: .65; }
.bgs-auth .bgs-auth-google { min-height: 52px; display: flex; justify-content: center; align-items: center; gap: .75rem; border: 1px solid var(--bgs-border); border-radius: .9rem; color: var(--bgs-text); font-weight: 600; }
.bgs-auth .bgs-auth-google:hover { background: var(--bgs-hover); }
.bgs-auth-google-mark { color: #4285f4; font-size: 1.3rem; font-weight: 800; }
.bgs-auth-divider { display: flex; align-items: center; gap: .75rem; margin: 1.4rem 0; color: var(--bgs-muted); font-size: .75rem; }
.bgs-auth-divider::before, .bgs-auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--bgs-border); }
.bgs-auth-register { margin: 1.5rem 0 0; text-align: center; font-size: .85rem; color: var(--bgs-muted); }
.bgs-auth-register a { font-weight: 700; }
.bgs-auth-legal { display: flex; justify-content: center; align-items: center; gap: .8rem; margin-top: 1rem; font-size: .75rem; color: var(--bgs-muted); }
.bgs-auth-legal a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; }
.bgs-auth a:focus-visible, .bgs-auth button:focus-visible { outline: 3px solid #8b5cf6; outline-offset: 3px; }
@media (min-width: 900px) {
    .bgs-auth { width: min(100%, 980px); display: grid; grid-template-columns: 1fr 420px; column-gap: 5rem; }
    .bgs-auth-brand { grid-column: 1; align-self: end; }
    .bgs-auth-intro { grid-column: 1; align-self: start; }
    .bgs-auth-intro h1 { font-size: 4.5rem; }
    .bgs-auth-panel { grid-column: 2; grid-row: 1 / 4; }
    .bgs-auth-legal { grid-column: 2; }
}
@media (max-width: 575px) {
    .bgs-auth-panel { padding: 0; border: 0; box-shadow: none; background: transparent; }
    .bgs-auth-brand { margin-bottom: 1.4rem; }
}

/* Login compatto: prevale sul padding della navigazione mobile condivisa. */
.bgs-body.bgs-login-screen .bgs-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}
.bgs-login-screen .bgs-shell > .row { flex: 1; min-width: 0; }
.bgs-body.bgs-login-screen .bgs-shell > .row > .bgs-main {
    padding: max(.5rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) max(.5rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
    align-content: center;
}
.bgs-auth-brand { margin-bottom: .5rem; font-size: 1.65rem; gap: .5rem; }
.bgs-auth-brand img { width: 36px; height: 36px; border-radius: 10px; }
.bgs-auth-intro h1 { font-size: clamp(1.75rem, 7vw, 2.25rem); line-height: 1.05; margin: 0 0 .75rem; }
.bgs-auth-panel { padding: 1rem; }
.bgs-auth-panel-title { font-size: 1.125rem; margin: 0 0 .5rem; }
.bgs-auth .form-label { margin-bottom: .25rem; }
.bgs-auth .form-control { min-height: 44px; height: 44px; font-size: 16px; }
.bgs-auth-field { margin-bottom: .5rem; }
.bgs-auth-password-label { min-height: 32px; margin-bottom: .125rem; }
.bgs-auth-password-label a { display: inline-flex; align-items: center; min-height: 44px; margin-block: -6px; }
.bgs-auth-reveal { right: 0; top: 0; }
.bgs-auth-remember { margin: 0 0 .25rem; }
.bgs-auth .bgs-auth-submit, .bgs-auth .bgs-auth-google { min-height: 44px; }
.bgs-auth-divider { margin: .5rem 0; line-height: 1.2; }
.bgs-auth-confirmation { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: .125rem; line-height: 1.25; }
.bgs-auth-register { margin: 0; line-height: 1.25; }
.bgs-auth-register a { display: inline-flex; align-items: center; min-height: 44px; }
.bgs-auth-legal { margin-top: 0; min-height: 44px; }
@media (max-width: 575px) {
    .bgs-auth-panel { padding: 0; }
    .bgs-auth-brand { margin-bottom: .5rem; }
}
@media (max-height: 700px) and (max-width: 899px) {
    .bgs-auth-brand { margin-bottom: .25rem; }
    .bgs-auth-intro h1 { font-size: 1.5rem; margin-bottom: .5rem; }
    .bgs-auth-title-break { display: none; }
    .bgs-auth-divider { margin: .375rem 0; }
}
@media (min-width: 900px) {
    .bgs-auth-intro h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
}
/* Se lo spazio cala per tastiera, landscape o testo ingrandito, resta tutto raggiungibile. */
@media (max-height: 500px) {
    .bgs-body.bgs-login-screen .bgs-shell > .row > .bgs-main { align-content: start; }
}

.bgs-login-screen .bgs-alert-stack:empty { display: none; }
@media (max-height: 700px) and (max-width: 899px) {
    .bgs-auth-field { margin-bottom: .25rem; }
    .bgs-auth-panel-title { margin-bottom: .25rem; }
    .bgs-auth-divider { margin-block: .25rem; }
    .bgs-auth-intro h1 { margin-bottom: .25rem; }
    .bgs-auth-brand { margin-bottom: .125rem; }
}
.bgs-auth-google-mark { line-height: 1; }
