/*! Desk Oesis - pagina di accesso */
/* La pagina di accesso e' SEMPRE in tema scuro, su ogni dispositivo e con qualunque tema di sistema. */
:root {
    color-scheme: dark;
    --brand-red: #e30613;
    --brand-ink: #0d1726;
    --brand-ink-2: #15233a;
    --bg: #0b1320;
    --card: #121c2c;
    --text: #e8edf4;
    --muted: #9aa6b8;
    --border: #26354d;
    --focus: #6f9bff;
    --error-bg: #3a1418;
    --error-fg: #ffb4b8;
    --warn-bg: #33270f;
    --warn-fg: #ffd28a;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body.login {
    font-family: "Titillium Web", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(380px, 44%) 1fr;
    min-height: 100vh;
}

/* ---------- pannello marchio ---------- */
.login-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    color: #fff;
    background:
        radial-gradient(1200px 600px at -10% 110%, rgba(227, 6, 19, .18), transparent 60%),
        linear-gradient(160deg, var(--brand-ink-2), var(--brand-ink));
    overflow: hidden;
}
.login-brand::after {
    content: "";
    position: absolute;
    top: 0; right: 0;
    width: 6px; height: 100%;
    background: var(--brand-red);
}
/* logo dell'installazione (desk_marchio): versione chiara diretta, le altre su una lastra bianca */
img.brand-logo, .brand-logo img { width: 150px; height: auto; display: block; }
.brand-logo { display: inline-block; }
.brand-logo--lastra { padding: 10px 14px; background: #fff; border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.brand-logo--lastra img { width: auto; max-width: 150px; max-height: 96px; }
.brand-eyebrow {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #ff8a91;
}
/* logo di Desk (templates/layout/_logo_desk.html.twig): all'apertura il punto della «i» salta una volta */
.brand-desk { display: block; width: auto; height: 64px; margin: 0 0 26px; overflow: visible; color: #fff; }
/* nome dell'applicativo (templates/layout/_marchio_nome.html.twig): logotipo del Desk + resto, o il nome in caratteri */
.desk-nome-app.brand-desk { display: flex; align-items: flex-end; gap: .28em; font-size: 64px; }
.desk-nome-app.brand-desk svg { display: block; height: 100%; width: auto; overflow: visible; }
.desk-nome-app.brand-desk .desk-nome-app__resto { font-size: .62em; font-weight: 600; line-height: .9; letter-spacing: -.01em; color: rgba(255, 255, 255, .86); }
/* logotipo proprio (es. patrimonia): riquadro con la discendente della p, lettere alte come quelle di desk */
.desk-nome-app.brand-desk.is-logo { height: 82px; margin-bottom: 12px; }
.desk-nome-app.brand-desk:not(.is-desk):not(.is-logo) {
    height: auto;
    font-family: "Titillium Web", "Inter", sans-serif;
    font-size: clamp(48px, 4.6vw, 66px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.02em;
}
.desk-nome-app.brand-desk:not(.is-desk):not(.is-logo) { gap: 0; }
.desk-nome-app.brand-desk:not(.is-desk):not(.is-logo)::after { content: ""; flex: none; width: .15em; height: .15em; margin: 0 0 .14em .07em; background: var(--brand-red); border-radius: 2px; }
.brand-desk .desk-logo__punto { transform-box: fill-box; transform-origin: 50% 50%; animation: dk-punto 1.3s .7s 1 both; }
@keyframes dk-punto {
    0%, 100% { transform: translateY(0); fill: #fff; }
    12% { transform: translateY(18%) scale(1.1, .9); fill: #fff; animation-timing-function: cubic-bezier(.2, .7, .4, 1); }
    22% { transform: translateY(-160%) scale(.85, 1.25); fill: #e30613; animation-timing-function: cubic-bezier(.3, .6, .5, 1); }
    46% { transform: translateY(-420%); fill: #e30613; animation-timing-function: cubic-bezier(.5, 0, .8, .5); }
    70% { transform: translateY(-80%) scale(.85, 1.25); fill: #e30613; }
    78% { transform: translateY(14%) scale(1.2, .8); fill: #fff; }
    88% { transform: translateY(-3%); fill: #fff; }
}
.brand-title {
    margin: 0 0 28px;
    font-size: clamp(28px, 2.6vw, 38px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.01em;
}
.brand-list { list-style: none; margin: 0; padding: 0; }
.brand-list li {
    position: relative;
    padding: 9px 0 9px 26px;
    color: rgba(255, 255, 255, .82);
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.brand-list li:last-child { border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand-list li::before {
    content: "";
    position: absolute;
    left: 2px; top: 50%;
    width: 8px; height: 8px;
    margin-top: -4px;
    background: var(--brand-red);
    border-radius: 2px;
}
.brand-foot { font-size: 13px; color: rgba(255, 255, 255, .55); }
.sep { margin: 0 8px; opacity: .6; }

/* ---------- pannello accesso ---------- */
.login-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px 24px;
}
.login-card {
    width: 100%;
    max-width: 420px;
    margin: auto 0;
    padding: 40px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 16px 40px rgba(0, 0, 0, .35);
}
.card-logo { display: none; width: 130px; height: auto; margin-bottom: 28px; }
.card-title { margin: 0 0 6px; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.card-sub { margin: 0 0 28px; color: var(--muted); }

.btn-ms {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 48px;
    padding: 0 20px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    color: #1f1f1f;
    text-decoration: none;
    background: #fff;
    border: 1px solid #fff;
    border-radius: 8px;
    transition: background-color .15s, box-shadow .15s, transform .05s;
}
.btn-ms:hover { background: #e9edf3; }
.btn-ms:active { transform: translateY(1px); }
.btn-ms:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--focus); }
.btn-ms.is-disabled { opacity: .45; cursor: not-allowed; }
.ms-mark { display: grid; grid-template-columns: 9px 9px; gap: 2px; }
.ms-mark span { width: 9px; height: 9px; }
.ms-mark span:nth-child(1) { background: #f25022; }
.ms-mark span:nth-child(2) { background: #7fba00; }
.ms-mark span:nth-child(3) { background: #00a4ef; }
.ms-mark span:nth-child(4) { background: #ffb900; }

.notice { margin: 0 0 20px; padding: 12px 14px; font-size: 14px; border-radius: 8px; }
.btn-ms + .notice { margin: 16px 0 0; }
.notice-error { background: var(--error-bg); color: var(--error-fg); }
.notice-warn { background: var(--warn-bg); color: var(--warn-fg); }
.notice-ok { background: #0f2e22; color: #8ee0b5; }

.card-note {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 28px 0 0;
    padding-top: 20px;
    font-size: 13px;
    color: var(--muted);
    border-top: 1px solid var(--border);
}
.card-note svg { flex: none; margin-top: 2px; }
/* canale delle segnalazioni (whistleblowing): pagina pubblica /segnalazioni */
.link-segnalazioni { display: inline-flex; gap: 8px; align-items: center; margin-top: 12px; font-size: 13px; color: var(--muted); text-decoration: none; }
.link-segnalazioni:hover, .link-segnalazioni:focus-visible { color: inherit; text-decoration: underline; }
.link-segnalazioni svg { flex: none; }

.login-foot { margin-top: 24px; font-size: 13px; color: var(--muted); text-align: center; }
.login-foot a { color: inherit; text-decoration: none; }
.login-foot a:hover { text-decoration: underline; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-brand { display: none; }
    .card-logo { display: block; }
}
/* ---------- mobile: hero del marchio in alto + pannello di accesso che sale dal fondo ---------- */
@media (max-width: 900px) {
    body.login { background: #0a1322; }
    .login-shell { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

    .login-brand {
        display: flex;
        flex: 1 0 auto;
        justify-content: flex-end;
        min-height: 40vh;
        min-height: 40dvh;
        padding: calc(88px + env(safe-area-inset-top)) 24px 52px;
        isolation: isolate;
        background:
            radial-gradient(120% 70% at 100% 0%, rgba(227, 6, 19, .42), transparent 62%),
            radial-gradient(90% 60% at 0% 100%, rgba(47, 99, 201, .5), transparent 66%),
            linear-gradient(170deg, #1b3463 0%, #11223f 55%, #0a1322 100%);
    }
    /* orbite che ruotano lentamente, ancorate in alto a destra */
    .login-brand::before {
        content: "";
        position: absolute;
        z-index: -1;
        top: -230px;
        right: -250px;
        width: 600px;
        height: 600px;
        background: url("../../assets/img/login/orbite.svg") center / contain no-repeat;
        animation: dk-orbita 140s linear infinite;
    }
    /* aurora che respira (al posto della riga rossa verticale del desktop) */
    .login-brand::after {
        z-index: -2;
        top: -20%;
        right: -20%;
        width: auto;
        height: auto;
        bottom: -20%;
        left: -20%;
        background:
            radial-gradient(38% 28% at 72% 22%, rgba(255, 77, 90, .30), transparent 70%),
            radial-gradient(36% 30% at 18% 72%, rgba(111, 155, 255, .24), transparent 70%);
        animation: dk-deriva 16s ease-in-out infinite alternate;
    }
    .brand-top { position: absolute; top: calc(24px + env(safe-area-inset-top)); left: 24px; }
    img.brand-logo, .brand-logo img { width: 112px; }
    .brand-logo--lastra { padding: 7px 10px; }
    .brand-logo--lastra img { width: auto; max-width: 112px; max-height: 46px; }
    .login-brand:has(.brand-logo--lastra) { padding-top: calc(108px + env(safe-area-inset-top)); }
    .brand-eyebrow {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 10px;
        font-size: 12px;
        letter-spacing: .22em;
    }
    .brand-eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--brand-red); border-radius: 2px; }
    .brand-desk { height: 46px; margin-bottom: 16px; }
    .desk-nome-app.brand-desk { font-size: 46px; }
    .desk-nome-app.brand-desk:not(.is-desk):not(.is-logo) { font-size: clamp(38px, 11vw, 52px); }
    .desk-nome-app.brand-desk.is-logo { height: 59px; margin-bottom: 10px; }
    /* su mobile la frase dell'installazione (desk_marchio) e' grande: la parte dopo la virgola in evidenza */
    .brand-title { margin: 0; font-size: clamp(30px, 9vw, 42px); line-height: 1.08; letter-spacing: -.02em; }
    .brand-title__accento {
        display: inline-block;
        padding-bottom: .08em;
        color: #ff6b75;
        background: linear-gradient(90deg, #ff5a66, #ffb3b8 55%, #a9c3ff);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
    .brand-list { display: none; }
    .brand-foot { display: none; }
    .brand-body > * { animation: dk-appare .6s cubic-bezier(.2, .8, .2, 1) both; }
    .brand-body > :nth-child(2) { animation-delay: .08s; }
    .brand-body > :nth-child(3) { animation-delay: .16s; }

    .login-panel {
        position: relative;
        z-index: 1;
        flex: none;
        margin-top: -26px;
        padding: 30px 22px calc(18px + env(safe-area-inset-bottom));
        background: linear-gradient(180deg, #131f33 0%, #0e1828 100%);
        border-radius: 26px 26px 0 0;
        box-shadow: 0 -20px 44px -12px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
        animation: dk-sale .6s cubic-bezier(.2, .8, .2, 1) both;
    }
    .login-panel::before {
        content: "";
        position: absolute;
        top: 0;
        left: 28px;
        right: 28px;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(255, 90, 102, .75), rgba(143, 178, 255, .55), transparent);
    }
    .login-card { max-width: 460px; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
    .card-logo { display: none; }
    .card-title { font-size: 25px; }
    .card-sub { margin-bottom: 22px; }
    .btn-ms { height: 52px; border-radius: 12px; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .7); }
    .input { height: 48px; border-radius: 10px; font-size: 16px; }
    .input-icon { width: 48px; height: 48px; }
    .btn-primary, .btn-secondary { height: 50px; border-radius: 12px; }
    .card-note { margin-top: 22px; padding-top: 16px; }
    .login-foot { margin-top: 18px; font-size: 12px; }
}
/* tablet e telefono in orizzontale: il testo dell'hero sta in colonna con il form */
@media (min-width: 600px) and (max-width: 900px) {
    .login-brand { padding-left: calc(50% - 230px); padding-right: calc(50% - 230px); }
    .brand-top { left: calc(50% - 230px); }
}
/* schermi bassi (telefono in orizzontale, smartphone piccoli): hero compatto */
@media (max-width: 900px) and (max-height: 720px) {
    .login-brand { min-height: 0; padding-bottom: 46px; }
}
@media (max-width: 900px) and (max-height: 500px) {
    .login-brand { padding-top: calc(72px + env(safe-area-inset-top)); }
    .brand-title::before, .brand-title::after { font-size: 26px; }
}
@keyframes dk-orbita { to { transform: rotate(360deg); } }
@keyframes dk-deriva { to { transform: translate3d(-7%, 5%, 0) scale(1.1); } }
@keyframes dk-sale { from { transform: translateY(56px); opacity: 0; } }
@keyframes dk-appare { from { transform: translateY(12px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- form credenziali / MFA ---------- */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    font-size: 13px;
    color: var(--muted);
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text); }
.input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font: inherit;
    color: var(--text);
    background: #0d1626;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #5f6c80; }
.input:hover { border-color: #33476a; }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(111, 155, 255, .25); }
.input-otp { font-size: 22px; letter-spacing: .5em; text-align: center; }
.input-area { height: auto; padding: 10px 14px; resize: vertical; }
.form-due { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .form-due { grid-template-columns: 1fr; } }
/* attivazione della verifica in due passaggi: QR su fondo bianco (le app lo leggono solo cosi') */
.mfa-qr { display: grid; justify-items: center; gap: 10px; text-align: center; }
.mfa-qr__img { display: block; width: 184px; padding: 12px; background: #fff; border-radius: 10px; }
.mfa-qr__img svg { display: block; width: 100%; height: auto; }
.mfa-qr__txt { font-size: 12px; color: var(--muted); }
.mfa-qr__txt code { display: block; margin-top: 4px; font-size: 14px; letter-spacing: .08em; color: var(--text); user-select: all; }
.input-wrap { position: relative; display: block; }
.input-wrap .input { padding-right: 46px; }
.input-icon {
    position: absolute;
    top: 0; right: 0;
    width: 44px; height: 44px;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: none;
    border: 0;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
}
.input-icon:hover, .input-icon[aria-pressed="true"] { color: var(--text); }
.input-icon:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus); }
.btn-primary, .btn-secondary {
    height: 46px;
    margin-top: 4px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.btn-primary { color: #fff; background: var(--brand-red); border: 1px solid var(--brand-red); }
.btn-primary:hover { background: #c40511; border-color: #c40511; }
.btn-secondary { color: var(--text); background: transparent; border: 1px solid var(--border); }
.btn-secondary:hover { background: rgba(255, 255, 255, .04); border-color: #33476a; }
.btn-primary:focus-visible, .btn-secondary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--focus); }
.btn-primary:disabled, .btn-secondary:disabled { opacity: .6; cursor: progress; }
.link-sub { justify-self: center; font-size: 13px; color: var(--muted); text-decoration: none; }
.link-sub:hover { color: var(--text); text-decoration: underline; }
.esca { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }
