/* Telas de acesso (login e recuperação de senha) — padrão visual dos sistemas UP IT Services.
   Espelha o auth.css do scan_notas_ppc (commit 31ecd10); se aquele mudar, espelhe aqui. */

:root {
    /* Identidade São Leopoldo Mandic: azul-marinho do tema (#1b2241 / #022643), o
       gradiente do botão que o sistema já usava e o dourado do brasão como realce. */
    --brand: #1b2241;
    --brand-deep: #022643;
    --brand-mid: #1e3a5f;
    --brand-light: #2c5282;
    --gold: #f5c518;
    --accent: #1e3a5f;
    --accent-hover: #2c5282;
    --accent-soft: #eaf0f7;
    --text: #1f2937;
    --text-muted: #6b7280;
    --bg: #f4f5f7;
    --border: #e5e7eb;
    --border-strong: #d9dde3;
    --radius: 12px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; }

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

body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text); }

.auth {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---------------------------------------------------------------- Painel da marca */

.auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    background: linear-gradient(145deg, var(--brand-deep) 0%, var(--brand) 60%, #101735 100%);
}

.auth-brand::after {
    content: "";
    position: absolute;
    right: -140px;
    bottom: -140px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(245, 197, 24, .10);
}

.auth-brand__logo {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    position: relative;
    z-index: 1;
}

.auth-brand__logo img {
    width: 150px;
    max-width: 100%;
    height: auto;
    background: #fff;
    border-radius: 14px;
    padding: 12px 16px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
}

.auth-brand__name { display: block; font-size: 17px; font-weight: 700; color: #fff; }
.auth-brand__tagline { display: block; font-size: 13px; color: rgba(255, 255, 255, .72); }

.auth-brand__content { position: relative; z-index: 1; max-width: 440px; }

.auth-brand__title {
    color: #fff;
    margin: 0 0 14px;
    font-size: 34px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.02em;
}

.auth-brand__text { margin: 0 0 28px; font-size: 15px; line-height: 1.6; color: rgba(255, 255, 255, .82); }

.auth-brand__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }

.auth-brand__list li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; font-weight: 500; color: rgba(255, 255, 255, .92); }

.auth-brand__list .fa {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .10);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: var(--gold);
}

.auth-brand__footer { position: relative; z-index: 1; font-size: 12.5px; color: rgba(255, 255, 255, .62); }

/* ---------------------------------------------------------------- Formulário */

.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-mobile-logo { display: none; }

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, .08);
    padding: 36px 32px;
}

.auth-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--brand-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    margin-bottom: 18px;
}

.auth-card__title { margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.auth-card__subtitle { margin: 0 0 26px; color: var(--text-muted); line-height: 1.55; }

.auth-field { margin-bottom: 16px; }

.auth-field label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }

.auth-input { position: relative; }

.auth-input .auth-input__icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 15px;
    pointer-events: none;
}

.auth-input input {
    width: 100%;
    height: 44px;
    padding: 0 42px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 14.5px;
    color: var(--text);
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-input input::placeholder { color: #9ca3af; }

.auth-input input:focus {
    outline: none;
    border-color: var(--brand-light);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, .20);
}

.auth-input__toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #9ca3af;
    font-size: 15px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
}

.auth-input__toggle:hover { color: var(--text); background: #f3f4f6; }

.auth-field.has-error .auth-input input { border-color: #f1a9a3; }
.auth-field.has-error .auth-input input:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }

.auth-field__error { margin-top: 6px; font-size: 13px; color: #b42318; }
.auth-field__hint { margin-top: 6px; font-size: 12.5px; color: var(--text-muted); }

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 22px;
}

/* Variante usada quando a linha tem só o link (este sistema não exibe "Lembrar-me":
   a sessão já é lembrada em todo login). */
.auth-options--end { justify-content: flex-end; }

.auth-check { display: inline-flex; align-items: center; gap: 8px; color: #374151; cursor: pointer; }
.auth-check input { width: 16px; height: 16px; accent-color: var(--brand-mid); margin: 0; }

.auth-link { color: var(--brand-mid); font-weight: 600; text-decoration: none; }
.auth-link:hover { color: var(--brand-deep); text-decoration: underline; }

/* Link que na verdade e um botao de submit (reenvio do codigo MFA, que precisa ser POST). */
.auth-link--button {
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.auth-button {
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--brand-mid) 0%, var(--brand-light) 100%);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.auth-button:hover { background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand-mid) 100%); }
.auth-button:focus { outline: none; box-shadow: 0 0 0 3px rgba(44, 82, 130, .35); }

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
}

.auth-back:hover { color: var(--text); }

.auth-card__footer {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
}

.auth-card__footer a { color: var(--text-muted); text-decoration: none; }
.auth-card__footer a:hover { color: var(--text); text-decoration: underline; }

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 13.5px;
    line-height: 1.5;
}

.auth-alert .fa { margin-top: 2px; }
.auth-alert--success { background: #e8f7ee; border-color: #bbe7cc; color: #14532d; }
.auth-alert--danger { background: #fdecec; border-color: #f8c9c5; color: #7a1d14; }

.auth-copyright { margin-top: 28px; font-size: 12.5px; color: var(--text-muted); text-align: center; }

/* ---------------------------------------------------------------- Responsivo */

@media (max-width: 991px) {
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth-brand { display: none; }
    .auth-main { justify-content: flex-start; padding-top: 32px; }

    .auth-mobile-logo {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 24px;
        text-decoration: none;
    }

    .auth-mobile-logo img { width: 130px; height: auto; background: #fff; border-radius: 10px; padding: 8px 10px; }
}

@media (max-width: 480px) {
    .auth-card { padding: 28px 22px; border-radius: 14px; }
    .auth-options { flex-direction: column; align-items: flex-start; }
}
