:root {
    --c-dark: #632324;
    --c-mid: #993635;
    --white: #ffffff;
    --ink: #2b1a1a;
    --muted: #8a7573;
    --field-bg: #f6f1f1;
    --field-border: #e7dcdc;
}

* { box-sizing: border-box; }

.auth-body {
    margin: 0;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1000px 500px at 10% 0%, #efe4e4, transparent 60%),
        radial-gradient(900px 500px at 100% 100%, #e9dede, transparent 55%),
        #f1e9e9;
    -webkit-font-smoothing: antialiased;
}

/* ============ Cartão dividido ============ */
.auth-split {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    width: min(940px, 100%);
    min-height: 520px;
    background: var(--white);
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 40px 80px -30px rgba(99, 35, 36, .45);
}

/* ============ Painel decorativo ============ */
.auth-aside {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 3rem 2.75rem;
    color: var(--white);
    background: linear-gradient(150deg, var(--c-mid) 0%, var(--c-dark) 85%);
    isolation: isolate;
}
.auth-aside::before {
    content: "";
    position: absolute;
    width: 360px; height: 360px;
    right: -120px; top: -120px;
    background: radial-gradient(circle at center, rgba(255, 255, 255, .10), transparent 65%);
    border-radius: 50%;
    z-index: -1;
}
.aside-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}
.aside-content { position: relative; }
.aside-content h1 {
    font-size: 2.4rem;
    line-height: 1.05;
    margin: 0 0 .9rem;
    font-weight: 800;
    letter-spacing: -.02em;
}
.aside-content p {
    margin: 0;
    max-width: 24ch;
    font-size: .98rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, .82);
}

/* Elementos decorativos */
.deco { position: absolute; z-index: -1; }
.deco-circle { border-radius: 50%; border: 2px solid rgba(255, 255, 255, .30); }
.deco-circle-1 { width: 22px; height: 22px; top: 16%; left: 22%; }
.deco-circle-2 { width: 40px; height: 40px; bottom: 14%; left: 10%; border-color: rgba(255, 255, 255, .22); }
.deco-plus { color: rgba(255, 255, 255, .5); font-size: 1.4rem; font-weight: 300; line-height: 1; }
.deco-plus-1 { top: 30%; left: 12%; }
.deco-plus-2 { bottom: 28%; right: 16%; font-size: 1.1rem; }
.deco-dots {
    top: 12%; right: 12%;
    width: 74px; height: 54px;
    background-image: radial-gradient(rgba(255, 255, 255, .55) 1.6px, transparent 1.7px);
    background-size: 13px 13px;
}

/* ============ Formulário ============ */
.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.75rem;
}
.auth-form-wrap { width: 100%; max-width: 320px; }

.auth-logo { height: 40px; width: auto; display: block; margin: 0 auto 1.75rem; }
.auth-brand {
    text-align: right;
    font-weight: 700;
    color: var(--c-mid);
    letter-spacing: .3px;
    margin-bottom: 1.5rem;
    font-size: .95rem;
}

.auth-main h2 {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 0 0 1.6rem;
    color: var(--ink);
}

.auth-alert {
    background: rgba(153, 54, 53, .10);
    border: 1px solid rgba(153, 54, 53, .28);
    color: var(--c-dark);
    padding: .7rem .85rem;
    border-radius: 10px;
    font-size: .88rem;
    margin-bottom: 1.1rem;
}

.auth-alert.auth-ok {
    background: rgba(18, 161, 80, .10);
    border-color: rgba(18, 161, 80, .30);
    color: #087443;
}

.in-group { position: relative; margin-bottom: 1rem; }
.in-icon {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    width: 19px; height: 19px;
    color: var(--c-mid);
    opacity: .8;
    pointer-events: none;
}
.in-group input {
    width: 100%;
    padding: .85rem 1rem .85rem 2.75rem;
    font-size: .98rem;
    color: var(--ink);
    background: var(--field-bg);
    border: 1.5px solid var(--field-border);
    border-radius: 11px;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.in-group input::placeholder { color: #a9938f; }
.in-group input:focus {
    background: var(--white);
    border-color: var(--c-mid);
    box-shadow: 0 0 0 4px rgba(153, 54, 53, .15);
}

.auth-btn {
    width: 100%;
    margin-top: .5rem;
    padding: .9rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    background: linear-gradient(135deg, var(--c-mid), var(--c-dark));
    border: none;
    border-radius: 11px;
    cursor: pointer;
    box-shadow: 0 12px 24px -10px rgba(99, 35, 36, .6);
    transition: filter .15s, transform .05s;
}
.auth-btn:hover { filter: brightness(1.07); }
.auth-btn:active { transform: translateY(1px); }

/* Alternativa: entrar com QR code */
.auth-sep { display: flex; align-items: center; gap: .8rem; margin: 1.1rem 0 .3rem; color: var(--muted); font-size: .82rem; }
.auth-sep::before, .auth-sep::after { content: ""; height: 1px; flex: 1; background: rgba(0, 0, 0, .12); }
.auth-btn-ghost {
    background: #fff; color: var(--c-dark);
    border: 1px solid rgba(99, 35, 36, .35); box-shadow: none;
}
.auth-btn-ghost:hover { filter: none; background: rgba(99, 35, 36, .06); }
.auth-link {
    display: inline-block; margin-top: .3rem; background: none; border: none;
    color: var(--c-mid); font-size: .85rem; cursor: pointer; text-decoration: underline;
}
.qr-login { text-align: center; margin-top: .4rem; }
.qr-login-hint { color: var(--muted); font-size: .88rem; margin: .2rem 0 .8rem; }
.qr-wrap { display: inline-flex; align-items: center; justify-content: center; padding: 10px; background: #fff; border: 1px solid rgba(0, 0, 0, .12); border-radius: 12px; min-width: 208px; min-height: 208px; }
.qr-wrap img, .qr-wrap canvas { display: block; }
.qr-login-status { margin: .7rem 0 .2rem; font-size: .9rem; font-weight: 600; color: var(--c-dark); }
.qr-login-timer { margin: .1rem 0 0; font-size: .8rem; color: var(--muted); }
.qr-login-timer span { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--c-mid); }

.auth-note {
    text-align: center;
    color: var(--muted);
    font-size: .82rem;
    margin: 1.4rem 0 0;
}

/* Subtítulo e campo de código (2FA) */
.auth-sub {
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.5;
    margin: -.9rem 0 1.3rem;
}
.auth-otp {
    width: 100%;
    padding: .9rem 1rem;
    margin-bottom: .5rem;
    background: var(--field-bg);
    border: 1.5px solid var(--field-border);
    border-radius: 11px;
    color: var(--ink);
    outline: none;
    text-align: center;
    letter-spacing: .5em;
    padding-left: 1.5em;
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-otp::placeholder { color: #cbb6b3; letter-spacing: .5em; }
.auth-otp:focus {
    background: var(--white);
    border-color: var(--c-mid);
    box-shadow: 0 0 0 4px rgba(153, 54, 53, .15);
}
.auth-logout { margin-top: .4rem; }
.auth-linkbtn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--c-mid);
    cursor: pointer;
    text-decoration: underline;
}
.auth-linkbtn:hover { color: var(--c-dark); }

/* ============ Responsivo ============ */
@media (max-width: 780px) {
    .auth-split { grid-template-columns: 1fr; min-height: 0; max-width: 420px; }
    .auth-aside {
        align-items: center;
        text-align: center;
        padding: 2.5rem 2rem;
    }
    .aside-content { display: flex; flex-direction: column; align-items: center; }
    .aside-content h1 { font-size: 2rem; }
    .aside-content p { max-width: 30ch; }
    .deco-circle-1, .deco-plus-1, .deco-plus-2 { display: none; }
    .auth-main { padding: 2.5rem 2rem; }
    .auth-form-wrap { max-width: 100%; }
}

@media (max-width: 420px) {
    .auth-body { padding: 0; }
    .auth-split { border-radius: 0; min-height: 100dvh; }
}

/* Utilitarios usados pelas telas de login. Duplicados do app.css de proposito:
   este layout nao carrega o app.css. Vieram de atributos style="" que a CSP
   deixou de permitir. */
.u-d-block_ta-center_td-none.u-d-block_ta-center_td-none { display:block; text-align:center; text-decoration:none; }
.u-w-auto_p-d4rem-d7rem_fs-d8rem.u-w-auto_p-d4rem-d7rem_fs-d8rem { width:auto; padding:.4rem .7rem; font-size:.8rem; }

/* Marca do Operations Center nas telas de login (login/2FA do public_noc). */
.auth-brand.noc-brand { font-size: 1.02rem; line-height: 1.3; }
