/* Telas de autenticação da Extranet (login, esqueci/redefinir senha) */
:root {
    --navy: #1a315b;
    --navy-2: #0f2142;
    --blue: #2f5fd0;
    --blue-hover: #244db0;
    --text: #1f2a44;
    --muted: #6b7690;
    --border: #d9dfeb;
    --bg: #f4f6fb;
    --danger: #c0392b;
    --success: #1e8e5a;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

.login {
    display: flex;
    min-height: 100vh;
}

/* ---------- Painel institucional ---------- */
.brand {
    position: relative;
    flex: 1 1 55%;
    overflow: hidden;
    color: #fff;
    background: radial-gradient(120% 90% at 0% 0%, #24427a 0%, var(--navy) 45%, var(--navy-2) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
}

@media (min-width: 992px) {
    .brand { position: sticky; top: 0; height: 100vh; }
}

.mosaic {
    position: absolute;
    inset: -2%;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-content: center;
    gap: 0;
    transform: rotate(-8deg) scale(1.25);
    transform-origin: center;
    pointer-events: none;
}

.mosaic img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    opacity: 0;
    animation: tileIn .8s ease forwards, glow 9s ease-in-out infinite;
    animation-delay: calc(var(--i) * 60ms), calc(1s + var(--i) * 450ms);
}

@keyframes tileIn { to { opacity: .18; } }
@keyframes glow {
    0%, 100% { opacity: .18; }
    50% { opacity: .45; }
}

.brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(15, 33, 66, .45) 0%, rgba(15, 33, 66, 0) 25%),
        linear-gradient(0deg, rgba(15, 33, 66, .95) 0%, rgba(15, 33, 66, .55) 35%, rgba(15, 33, 66, 0) 60%);
    pointer-events: none;
}

.brand > :not(.mosaic) { position: relative; z-index: 1; }

.brand-logo img { height: 52px; width: auto; display: block; }

.brand-copy h2 {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 14px;
    letter-spacing: -.5px;
}

.brand-copy p {
    font-size: 1.1rem;
    line-height: 1.55;
    margin: 0;
    max-width: 460px;
    color: rgba(255, 255, 255, .82);
}

.brand-copy .tag {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    margin-bottom: 18px;
}

.brand-foot {
    margin-top: 28px;
    font-size: .85rem;
    color: rgba(255, 255, 255, .6);
}

/* ---------- Formulário ---------- */
.panel {
    flex: 1 1 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: #fff;
}

.card {
    width: 100%;
    max-width: 400px;
}

.card-logo { height: 64px; width: auto; display: block; margin-bottom: 36px; }

.card h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0 0 6px;
    color: var(--navy);
}

.card .lead {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: .98rem;
}

.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: .92rem;
    margin-bottom: 18px;
    line-height: 1.4;
}

.alert i { margin-top: 2px; }
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f6c9c3; }
.alert-success { background: #e8f6ef; color: var(--success); border: 1px solid #bfe6d2; }

.field { margin-bottom: 18px; }

.field label {
    display: block;
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: 7px;
    color: var(--text);
}

.input-wrap { position: relative; }

.input-wrap .ico {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa4ba;
    font-size: .95rem;
    pointer-events: none;
    transition: color .2s;
}

.input-wrap input {
    width: 100%;
    height: 52px;
    padding: 0 48px 0 46px;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    font: inherit;
    font-size: 1rem;
    color: var(--text);
    background: #fafbfe;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.input-wrap input::placeholder { color: #a7b0c3; }

.input-wrap input:focus {
    outline: none;
    border-color: var(--blue);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(47, 95, 208, .14);
}

.input-wrap:focus-within .ico { color: var(--blue); }

.toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #9aa4ba;
    cursor: pointer;
}

.toggle-pass:hover, .toggle-pass:focus-visible { color: var(--blue); background: #eef2fb; outline: none; }

.hint { display: block; margin-top: 7px; font-size: .82rem; color: var(--muted); }

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 20px;
    font-size: .92rem;
}

.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; margin: 0; }

.link { color: var(--blue); font-weight: 700; text-decoration: none; }
.link:hover { text-decoration: underline; }

.captcha { margin-bottom: 20px; min-height: 78px; }

.btn {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue) 0%, #2a4fb8 100%);
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .3px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 22px -10px rgba(47, 95, 208, .7);
    transition: transform .15s, box-shadow .2s, filter .2s;
}

.btn:hover { filter: brightness(1.06); box-shadow: 0 14px 26px -10px rgba(47, 95, 208, .8); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(47, 95, 208, .35); outline-offset: 2px; }
.btn[disabled] { opacity: .75; cursor: wait; }

.card-foot {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #edf0f6;
    font-size: .82rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---------- Responsivo ---------- */
@media (max-width: 991.98px) {
    .login { flex-direction: column; }

    .brand {
        flex: none;
        min-height: 190px;
        padding: 28px 24px;
    }

    .mosaic { grid-template-columns: repeat(7, 1fr); transform: rotate(-8deg) scale(1.4); }
    .brand-copy h2 { font-size: 1.6rem; margin-bottom: 0; }
    .brand-copy p, .brand-copy .tag, .brand-foot { display: none; }
    .brand-logo img { height: 40px; }
    .brand { justify-content: flex-start; gap: 18px; }

    .panel { flex: 1; align-items: flex-start; padding: 32px 16px 40px; }
    .card-logo { display: none; }
}

@media (max-width: 360px) {
    .captcha { transform: scale(.88); transform-origin: left top; }
}

@media (prefers-reduced-motion: reduce) {
    .mosaic img { animation: none; opacity: .2; }
}

/* ---------- Extras: telas de senha ---------- */
.icon-badge {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2fb;
    color: var(--blue);
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.rules {
    list-style: none;
    margin: 10px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f6f8fc;
    border: 1px solid #edf0f6;
    font-size: .84rem;
    color: var(--muted);
}

.rules li { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; transition: color .2s; }
.rules li i { width: 12px; text-align: center; }
.rules li.ok { color: var(--success); }
.rules li.fail { color: var(--danger); }

.field-error { display: none; margin-top: 7px; font-size: .82rem; color: var(--danger); }
.field.has-error .field-error { display: block; }
.field.has-error input { border-color: var(--danger); }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    font-size: .92rem;
}
