:root {
    --sig-ink: #1d2733;
    --sig-muted: #5b6b7b;
    --sig-primary: #004494;
    --sig-primary-700: #002a5c;
    --sig-primary-050: #eef3fa;
    --sig-surface: #ffffff;
    --sig-bg: #f4f6f9;
    --sig-border: #dce3ec;
    --sig-danger: #d32f2f;
    --sig-danger-050: #fdecea;
    --sig-success: #2e7d32;
    --sig-success-050: #eaf3ea;
    --sig-warning: #f57f17;
    --sig-warning-050: #fef4e6;
    --sig-radius: 6px;
    --sig-shadow-md: 0 4px 6px -1px rgba(16, 24, 40, .08), 0 2px 4px -2px rgba(16, 24, 40, .04);
    --sig-shadow-lg: 0 24px 48px -12px rgba(0, 42, 92, .22);
    --sig-focus: 0 0 0 3px rgba(0, 68, 148, .25);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--sig-ink);
    background-color: var(--sig-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem 1.25rem;
}

/* --- Cartão dividido --- */
.auth-card {
    position: relative;
    width: 100%;
    max-width: 62rem;
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    background-color: var(--sig-surface);
    border: 1px solid var(--sig-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--sig-shadow-lg);
    transition: filter .3s ease;
    animation: auth-rise .5s cubic-bezier(.2, .7, .3, 1) both;
}

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Painel de marca (a assinatura: azul institucional como superfície + grade de dossiê) --- */
.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2.5rem;
    padding: 2.75rem 2.5rem;
    color: #fff;
    background-color: var(--sig-primary-700);
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        radial-gradient(120% 90% at 15% 0%, rgba(0, 68, 148, .55) 0%, transparent 60%);
    background-size: 100% 34px, 100% 100%;
    isolation: isolate;
}

.auth-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 34px 100%;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22%);
            mask-image: linear-gradient(90deg, transparent 0, #000 22%);
    opacity: .8;
}

.auth-eyebrow {
    margin: 0 0 1.1rem;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .62);
}

.auth-wordmark {
    margin: 0;
    font-family: 'Archivo', 'Inter', sans-serif;
    font-weight: 800;
    font-size: clamp(2.4rem, 6vw, 3.1rem);
    line-height: .95;
    letter-spacing: -.02em;
}

.auth-fullname {
    margin: .9rem 0 0;
    max-width: 22ch;
    font-size: .98rem;
    font-weight: 400;
    line-height: 1.45;
    color: rgba(255, 255, 255, .8);
}

.auth-brand__bottom {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-brand__bottom::before {
    content: "";
    height: 1px;
    width: 3.25rem;
    background: rgba(255, 255, 255, .35);
}

.auth-sejus {
    display: inline-flex;
    width: fit-content;
    border-radius: var(--sig-radius);
}
.auth-sejus img {
    display: block;
    max-width: 148px;
    height: auto;
}
.auth-sejus:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .5);
}

.auth-note {
    margin: 0;
    font-size: .78rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, .6);
}

/* --- Painel do formulário --- */
.auth-form {
    display: flex;
    align-items: center;
    padding: 2.75rem 2.75rem 2.5rem;
}
.auth-form__inner { width: 100%; }

.auth-head { margin-bottom: 1.75rem; }
.auth-title {
    margin: 0;
    font-family: 'Archivo', 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--sig-ink);
}
.auth-subtitle {
    margin: .4rem 0 0;
    font-size: .9rem;
    color: var(--sig-muted);
}

/* --- Mensagens --- */
.auth-messages {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin-bottom: 1.5rem;
}
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .75rem .9rem;
    border: 1px solid var(--sig-border);
    border-left-width: 3px;
    border-radius: var(--sig-radius);
    font-size: .88rem;
    line-height: 1.4;
    color: var(--sig-ink);
    background: var(--sig-bg);
}
.auth-alert svg { flex: 0 0 auto; margin-top: .05rem; }
.auth-alert.alert-danger  { border-left-color: var(--sig-danger);  background: var(--sig-danger-050); }
.auth-alert.alert-danger svg  { color: var(--sig-danger); }
.auth-alert.alert-success { border-left-color: var(--sig-success); background: var(--sig-success-050); }
.auth-alert.alert-success svg { color: var(--sig-success); }
.auth-alert.alert-warning { border-left-color: var(--sig-warning); background: var(--sig-warning-050); }
.auth-alert.alert-warning svg { color: var(--sig-warning); }
.auth-alert.alert-info    { border-left-color: var(--sig-primary); background: var(--sig-primary-050); }
.auth-alert.alert-info svg    { color: var(--sig-primary); }

/* --- Campos --- */
.auth-field { margin-bottom: 1.15rem; }
.auth-field label {
    display: block;
    margin-bottom: .4rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--sig-ink);
}
.auth-control { position: relative; }
.auth-field input {
    width: 100%;
    padding: .72rem .9rem;
    font-family: inherit;
    font-size: .95rem;
    color: var(--sig-ink);
    background: var(--sig-surface);
    border: 1px solid var(--sig-border);
    border-radius: var(--sig-radius);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-field input::placeholder { color: #9aa7b4; }
.auth-field input:focus {
    outline: none;
    border-color: var(--sig-primary);
    box-shadow: var(--sig-focus);
}
.auth-field input.has-toggle { padding-right: 2.9rem; }

.auth-toggle {
    position: absolute;
    top: 50%;
    right: .35rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    border: none;
    border-radius: var(--sig-radius);
    color: var(--sig-muted);
    background: transparent;
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
}
.auth-toggle:hover { color: var(--sig-primary); background: var(--sig-primary-050); }
.auth-toggle:focus-visible { outline: none; box-shadow: var(--sig-focus); color: var(--sig-primary); }
.auth-toggle .icon-hide { display: none; }
.auth-toggle.is-on .icon-show { display: none; }
.auth-toggle.is-on .icon-hide { display: block; }

/* --- Botão --- */
.auth-submit {
    width: 100%;
    margin-top: .5rem;
    padding: .8rem 1rem;
    font-family: inherit;
    font-size: .96rem;
    font-weight: 600;
    color: #fff;
    background: var(--sig-primary);
    border: 1px solid var(--sig-primary);
    border-radius: var(--sig-radius);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.auth-submit:hover { background: var(--sig-primary-700); border-color: var(--sig-primary-700); }
.auth-submit:focus-visible { outline: none; box-shadow: var(--sig-focus); }
.auth-submit:disabled { opacity: .7; cursor: progress; }

/* --- Rodapé --- */
.auth-footer {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .78rem;
    color: var(--sig-muted);
    text-align: center;
}

/* --- Loader --- */
.auth-loader {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(244, 246, 249, .72);
    -webkit-backdrop-filter: blur(3px);
            backdrop-filter: blur(3px);
}
.auth-card.loading { filter: blur(1.5px); }
.auth-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid var(--sig-border);
    border-top-color: var(--sig-primary);
    border-radius: 50%;
    animation: auth-spin .8s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* --- Responsivo --- */
@media (max-width: 880px) {
    .auth-card { grid-template-columns: 1fr; max-width: 30rem; }
    .auth-brand {
        gap: 1.4rem;
        padding: 1.9rem 1.75rem;
        background-size: 100% 30px, 100% 100%;
    }
    .auth-brand__bottom { flex-direction: row; align-items: center; justify-content: space-between; }
    .auth-brand__bottom::before { display: none; }
    .auth-note { display: none; }
    .auth-sejus img { max-width: 120px; }
    .auth-fullname { max-width: none; }
    .auth-form { padding: 2rem 1.75rem; }
}

@media (max-width: 400px) {
    .auth-wrap { padding: 1.25rem .85rem; }
    .auth-brand { padding: 1.6rem 1.4rem; }
    .auth-form { padding: 1.6rem 1.4rem; }
    .auth-footer { flex-direction: column; gap: .35rem; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-card { animation: none; }
    .auth-spinner { animation-duration: 1.6s; }
    .auth-submit, .auth-field input, .auth-toggle { transition: none; }
}
