/* ==========================================================================
   SIRIOS - telas de acesso (login e carregamento)
   Layout dividido: painel da marca (esquerda) + formulario/status (direita).
   As cores vem das variaveis do tema ativo (css/aqiCss.css); os valores depois
   da virgula sao o padrao quando o tema nao define a variavel.
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

body.ac-page {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--sx-text, #1e293b);
    background: var(--sx-surface, #fff);
    -webkit-font-smoothing: antialiased;
}

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

/* ---------- Painel da marca ---------- */
.ac-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 52px 56px 40px;
    color: #fff;
    background:
        radial-gradient(110% 80% at 0% 0%, rgba(255, 255, 255, .13), rgba(255, 255, 255, 0) 60%),
        var(--sx-topbar, var(--sx-navy, #0e2238));
    border-right: 4px solid var(--sx-primary, #1d5fa7);
}
.ac-brand-top { position: relative; z-index: 2; }
.ac-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 108px;
    height: 88px;
    padding: 8px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .30);
}
.ac-logo img { display: block; max-width: 100%; max-height: 100%; }
.ac-wordmark {
    margin: 30px 0 0;
    font-size: 42px;
    font-weight: 700;
    letter-spacing: .2em;
    line-height: 1;
    color: #fff;
}
.ac-tag {
    margin: 14px 0 0;
    max-width: 340px;
    font-size: 15px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .84);
}
.ac-rule {
    width: 48px;
    height: 3px;
    margin-top: 24px;
    border-radius: 2px;
    background: var(--sx-primary, #1d5fa7);
}
.ac-chart {
    position: absolute;
    right: -110px;
    bottom: -130px;
    width: 600px;
    height: 600px;
    z-index: 1;
    pointer-events: none;
}
.ac-brand-foot {
    position: relative;
    z-index: 2;
    font-size: 12px;
    letter-spacing: .05em;
    color: rgba(255, 255, 255, .66);
}

/* ---------- Area principal ---------- */
.ac-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px;
    background: var(--sx-surface, #fff);
}
.ac-panel { width: 100%; max-width: 380px; margin: auto 0; }
.ac-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 16px;
    width: 100%;
    max-width: 380px;
    padding-top: 16px;
    border-top: 1px solid var(--sx-line, #e2e8f0);
    font-size: 12px;
    color: var(--sx-muted, #5b6b7e);
}
.ac-foot span { display: inline-flex; align-items: center; gap: 6px; }

body.ac-page .ac-title {
    margin: 0 0 6px;
    font-family: inherit;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1.2;
    color: var(--sx-strong, var(--sx-navy, #0e2238));
}
.ac-lead { margin: 0 0 26px; font-size: 14.5px; color: var(--sx-muted, #5b6b7e); }

/* ---------- Formulario ---------- */
.ac-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid rgba(185, 28, 28, .32);
    border-left: 4px solid #b91c1c;
    border-radius: 8px;
    background: rgba(185, 28, 28, .08);
    color: var(--sx-bad-text, #991b1b);
    font-size: 13.5px;
}
.ac-alert svg { flex: 0 0 auto; margin-top: 2px; }

.ac-field { margin-bottom: 18px; }
body.ac-page .ac-label {
    display: block;
    margin: 0 0 7px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--sx-strong, #1e293b);
}
body.ac-page .ac-input {
    display: block;
    width: 100%;
    height: 46px;
    margin: 0;
    padding: 0 14px;
    font: inherit;
    font-size: 15px;
    color: var(--sx-text, #1e293b);
    background-color: var(--sx-input, #fff);
    border: 1px solid var(--sx-line-2, #94a3b8);
    border-radius: 8px;
    box-shadow: none;
    outline: 0;
    transition: border-color .15s, box-shadow .15s;
}
body.ac-page .ac-input:focus {
    border-color: var(--sx-primary, #1d5fa7);
    box-shadow: 0 0 0 1px var(--sx-primary, #1d5fa7), 0 0 0 5px rgba(127, 135, 145, .18);
}
body.ac-page .ac-input::placeholder { color: #7a8798; }
body.ac-page select.ac-input {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2394a3b8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
body.ac-page .ac-input.has-toggle { padding-right: 50px; }

.ac-pass { position: relative; }
.ac-eye {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--sx-muted, #5b6b7e);
    cursor: pointer;
}
.ac-eye:hover { background: rgba(127, 135, 145, .18); color: var(--sx-text, #1e293b); }
.ac-eye .ac-eye-off { display: none; }
.ac-eye.is-on .ac-eye-on { display: none; }
.ac-eye.is-on .ac-eye-off { display: block; }

.ac-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 24px;
}
.ac-check { display: flex; align-items: center; gap: 9px; margin: 0; cursor: pointer; color: var(--sx-text, #334155); }
.ac-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--sx-primary, #1d5fa7); }
body.ac-page .ac-link { color: var(--sx-link, var(--sx-primary, #1d5fa7)); font-size: 13.5px; font-weight: 500; text-decoration: none; }
body.ac-page .ac-link:hover { text-decoration: underline; }

.ac-btn {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .03em;
    cursor: pointer;
    color: var(--sx-on-primary, #fff);
    background: var(--sx-primary, #1d5fa7);
    transition: filter .15s;
}
.ac-btn:hover { filter: brightness(.92); }
.ac-btn:focus-visible { outline: 2px solid var(--sx-primary, #1d5fa7); outline-offset: 3px; }

/* ---------- Tela de carregamento ---------- */
.rd-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.rd-spinner {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: 3px solid var(--sx-line, #e2e8f0);
    border-top-color: var(--sx-primary, #1d5fa7);
    border-radius: 50%;
    animation: rdSpin .9s linear infinite;
}
@keyframes rdSpin { to { transform: rotate(360deg); } }
.rd-track {
    width: 100%;
    height: 6px;
    margin-bottom: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--sx-surface-3, #e2e8f0);
}
.rd-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--sx-primary, #1d5fa7);
    animation: rdFill 4s linear forwards;
}
@keyframes rdFill { from { width: 0%; } to { width: 100%; } }
.rd-status {
    min-height: 1.5em;
    margin: 0;
    font-size: 14px;
    color: var(--sx-muted, #5b6b7e);
    transition: opacity .3s ease;
}
.rd-status.fade { opacity: 0; }
.rd-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--sx-ok, #15803d); }

/* ---------- Telas menores ---------- */
@media (max-width: 900px) {
    .ac-shell { grid-template-columns: 1fr; min-height: 0; }
    .ac-brand {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 18px;
        padding: 22px 24px;
        border-right: 0;
        border-bottom: 4px solid var(--sx-primary, #1d5fa7);
    }
    .ac-brand-top { display: flex; align-items: center; gap: 18px; }
    .ac-logo { width: 72px; height: 58px; padding: 5px; }
    .ac-wordmark { margin: 0; font-size: 26px; }
    .ac-tag, .ac-rule, .ac-chart, .ac-brand-foot { display: none; }
    .ac-main { padding: 28px 20px 24px; }
    .ac-panel { margin: 0; padding-bottom: 28px; }
}
@media (prefers-reduced-motion: reduce) {
    .rd-spinner { animation: none; }
}
