/* =========================================================
   SIPTTEX GC — Login "Split"
   Painel escuro de marca à esquerda + formulário limpo à direita.
   Mesmo desenho do login das aplicações XAF Blazor (variante
   ActiveSource "Split"), adaptado a WebForms (asp:Login).
   Autocontido: todas as variáveis estão em #sx-logon.
   ========================================================= */

#sx-logon {
    --sx-accent: #1a87e6;
    --sx-accent-soft: #4da9f6;
    --sx-accent-ring: rgba(26, 135, 230, .18);
    --sx-dark: #14181d;
    --sx-dark-2: #1b2026;
    --sx-text: #1b2026;
    --sx-muted: #6b7280;
    --sx-line: #d8dde3;
    --sx-field-bg: #fbfcfd;
    --sx-danger: #c0392b;
    --sx-danger-bg: #fdf0ee;
    --sx-danger-line: #f3c4bd;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    display: grid;
    grid-template-columns: 58% 42%;
    background: #ffffff;
}

html, body.login-split {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #ffffff;
    color: #1b2026;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.login-split form {
    margin: 0;
}

#sx-logon *, #sx-logon *::before, #sx-logon *::after {
    box-sizing: border-box;
}

/* ---------------------------------------------------------
   PAINEL ESQUERDO — marca
   --------------------------------------------------------- */
.sx-left {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(46vw 46vw at 88% 112%, rgba(26, 135, 230, .26), transparent 60%),
        radial-gradient(40vw 40vw at -6% -10%, rgba(107, 114, 128, .30), transparent 58%),
        linear-gradient(160deg, var(--sx-dark-2), var(--sx-dark) 55%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

    /* textura de grelha muito subtil */
    .sx-left::before {
        content: "";
        position: absolute;
        inset: 0;
        opacity: .05;
        pointer-events: none;
        background-image:
            linear-gradient(rgba(255, 255, 255, .9) 1px, transparent 1px),
            linear-gradient(90deg, rgba(255, 255, 255, .9) 1px, transparent 1px);
        background-size: 52px 52px;
        -webkit-mask: radial-gradient(70vw 55vw at 50% 45%, #000 30%, transparent 75%);
        mask: radial-gradient(70vw 55vw at 50% 45%, #000 30%, transparent 75%);
    }

.sx-left-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.sx-left-logo {
    width: clamp(180px, 22vw, 300px);
    height: auto;
    /* logo-sipttex.svg é vetorial (preto): inverte-se para o painel escuro */
    filter: invert(1) brightness(1.15) drop-shadow(0 18px 44px rgba(0, 0, 0, .35));
}

.sx-left-product {
    color: rgba(255, 255, 255, .92);
    font-size: clamp(13px, 1.1vw, 16px);
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.sx-left-pitch {
    position: relative;
    margin-top: 28px;
    text-align: center;
    color: rgba(255, 255, 255, .62);
    font-size: clamp(12px, 1.2vw, 18px);
    line-height: 1.65;
    max-width: min(560px, 80%);
}

    .sx-left-pitch b {
        color: rgba(255, 255, 255, .92);
        font-weight: 650;
    }

.sx-left-chips {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 11px;
    margin-top: 30px;
}

.sx-chip {
    font-size: clamp(9px, .9vw, 13px);
    font-weight: 600;
    letter-spacing: .05em;
    color: rgba(255, 255, 255, .75);
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .05);
    padding: 6px 16px;
    border-radius: 999px;
}

.sx-left-footer {
    position: absolute;
    bottom: 28px;
    right: 34px;
    color: rgba(255, 255, 255, .45);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
    text-decoration: none;
    text-transform: none;
}

    .sx-left-footer strong {
        font-weight: 600;
        color: rgba(255, 255, 255, .8);
    }

    .sx-left-footer:hover {
        color: rgba(255, 255, 255, .8);
    }

/* ---------------------------------------------------------
   PAINEL DIREITO — formulário
   --------------------------------------------------------- */
.sx-right {
    position: relative;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 34px;
}

.sx-right-inner {
    width: min(420px, 100%);
    animation: sx-rise .6s .1s cubic-bezier(.2, .8, .3, 1) both;
}

.sx-brand {
    display: grid;
    place-items: center;
    margin-bottom: 27px;
    min-height: 40px;
}

    .sx-brand img {
        max-width: min(240px, 70%);
        max-height: 110px;
        width: auto;
        height: auto;
    }

    /* logótipo SIPTTEX (marca do produto) */
    .sx-brand .sx-brand-product {
        width: 200px;
        max-height: 40px;
    }

.sx-title {
    text-align: center;
    margin: 0;
    font-size: clamp(20px, 1.75vw, 27px);
    font-weight: 700;
    color: var(--sx-text);
    letter-spacing: -.01em;
}

.sx-hint {
    text-align: center;
    color: var(--sx-muted);
    font-size: 12px;
    margin: 8px 0 27px;
}

/* Alertas (falha de login / validação) */
.sx-alert {
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.45;
}

    .sx-alert:empty {
        display: none;
    }

    .sx-alert.sx-alert-error {
        color: var(--sx-danger);
        background: var(--sx-danger-bg);
        border: 1px solid var(--sx-danger-line);
    }

    .sx-alert ul {
        margin: 0;
        padding-left: 18px;
    }

/* Campos */
.sx-field {
    margin-bottom: 16px;
}

.sx-label {
    display: block;
    font-weight: 600;
    color: #3c4650;
    font-size: 13px;
    margin-bottom: 6px;
}

.sx-input-wrap {
    position: relative;
}

    .sx-input-wrap > .fa {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: #9aa3ad;
        font-size: 14px;
        pointer-events: none;
        transition: color .15s;
    }

    .sx-input-wrap:focus-within > .fa {
        color: var(--sx-accent);
    }

/* #sx-logon: ganha ao tema global App_Themes (input[type=text]) que também chega ao login */
#sx-logon .sx-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--sx-line);
    border-radius: 10px;
    background-color: var(--sx-field-bg);
    color: var(--sx-text);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}

    #sx-logon .sx-input::placeholder {
        color: #a3abb4;
    }

    #sx-logon .sx-input:focus {
        border-color: var(--sx-accent);
        box-shadow: 0 0 0 4px var(--sx-accent-ring);
        background-color: #fff;
    }

    /* autofill do browser sem fundo amarelo */
    #sx-logon .sx-input:-webkit-autofill,
    #sx-logon .sx-input:-webkit-autofill:focus {
        -webkit-box-shadow: 0 0 0 1000px #fff inset;
        -webkit-text-fill-color: var(--sx-text);
        transition: background-color 9999s ease-in-out 0s;
    }

#sx-logon .sx-input-wrap.sx-has-toggle .sx-input {
    padding-right: 44px;
}

.sx-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #9aa3ad;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 14px;
}

    .sx-eye:hover {
        color: var(--sx-accent);
        background: rgba(26, 135, 230, .08);
    }

    .sx-eye:focus-visible {
        outline: 2px solid var(--sx-accent);
        outline-offset: 1px;
    }

/* Linha "manter sessão" + "esqueceu-se" */
.sx-row {
    display: flex;
    flex-wrap: wrap; /* em ecrãs estreitos a ligação passa para a linha seguinte em vez de partir o texto da caixa */
    align-items: center;
    justify-content: space-between;
    gap: 10px 12px;
    margin: 2px 0 20px;
    font-size: 13px;
}

.sx-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3c4650;
}

    .sx-check input[type="checkbox"] {
        width: 16px;
        height: 16px;
        margin: 0;
        accent-color: var(--sx-accent);
        cursor: pointer;
    }

    .sx-check label {
        margin: 0;
        padding: 0;
        white-space: nowrap;
        font-size: inherit;
        color: inherit;
        cursor: pointer;
        font-weight: 500;
    }

.sx-forgot {
    color: var(--sx-accent);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

    .sx-forgot:hover {
        text-decoration: underline;
    }

/* Botão principal */
.sx-btn-primary {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(180deg, var(--sx-accent-soft), var(--sx-accent));
    box-shadow: 0 10px 26px rgba(26, 135, 230, .35);
    transition: transform .12s, box-shadow .12s, filter .12s;
}

    .sx-btn-primary:hover {
        filter: brightness(1.04);
        transform: translateY(-1px);
        box-shadow: 0 13px 32px rgba(26, 135, 230, .42);
    }

    .sx-btn-primary:active {
        transform: none;
        filter: brightness(.95);
    }

    /* variante como ligação (<a>) */
    a.sx-btn-primary {
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }

    .sx-btn-primary:focus-visible {
        outline: 3px solid var(--sx-accent-ring);
        outline-offset: 2px;
    }

/* Botão secundário (ligação) */
.sx-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    margin-top: 12px;
    border: 1px solid var(--sx-line);
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    font-size: 13px;
    color: #3c4650;
    background: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .15s, background-color .15s, color .15s;
}

    .sx-btn-secondary:hover {
        border-color: var(--sx-accent);
        color: var(--sx-accent);
        background: rgba(26, 135, 230, .04);
        text-decoration: none;
    }

/* Bloco de sucesso (ex.: palavra-passe enviada) */
.sx-success {
    text-align: center;
    padding: 8px 0 4px;
}

    .sx-success .sx-success-icon {
        width: 64px;
        height: 64px;
        margin: 0 auto 16px;
        border-radius: 50%;
        display: grid;
        place-items: center;
        background: #e8f6ee;
        color: #1e9e5a;
        font-size: 28px;
    }

    .sx-success p {
        margin: 0 0 20px;
        color: #3c4650;
        font-size: 14px;
        line-height: 1.6;
    }

/* ---------------------------------------------------------
   Páginas de estado (erro, 404, acesso negado)
   --------------------------------------------------------- */
.sx-status {
    text-align: center;
}

.sx-status-code {
    font-size: clamp(56px, 6vw, 84px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.03em;
    color: #eef1f4;
    margin-bottom: -22px;
    user-select: none;
}

.sx-status-icon {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 26px;
    background: #eaf2fc;
    color: var(--sx-accent);
}

    .sx-status-icon.sx-status-icon-error {
        background: var(--sx-danger-bg);
        color: var(--sx-danger);
    }

    .sx-status-icon.sx-status-icon-warn {
        background: #fff4e0;
        color: #c77700;
    }

.sx-status .sx-hint {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.sx-status .sx-alert {
    text-align: left;
}

.sx-actions {
    margin-top: 4px;
}

    .sx-actions .sx-btn-primary .fa,
    .sx-actions .sx-btn-secondary .fa {
        margin-right: 6px;
    }

.sx-trace {
    text-align: left;
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    line-height: 1.5;
    color: #3c4650;
    background: #f5f7f9;
    border: 1px solid var(--sx-line);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0 0 16px;
    max-height: 260px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

    .sx-trace:empty {
        display: none;
    }

.sx-form-foot {
    margin-top: 27px;
    text-align: center;
    color: #a3abb4;
    font-size: 11px;
    line-height: 1.6;
}

    .sx-form-foot a {
        color: #7c8792;
        text-decoration: none;
    }

        .sx-form-foot a:hover {
            color: var(--sx-accent);
        }

@keyframes sx-rise {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.97);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sx-right-inner {
        animation: none;
    }

    .sx-btn-primary {
        transition: none;
    }
}

/* Responsivo: em ecrãs pequenos esconde o painel escuro e centra o formulário */
@media (max-width: 992px) {
    #sx-logon {
        grid-template-columns: 1fr;
    }

    .sx-left {
        display: none;
    }

    .sx-right {
        padding: 22px 16px;
        min-height: 100vh;
    }
}
