/* Telas de autenticação (login, cadastro): templates/auth_header.php + auth_footer.php */

.auth-body { min-height: 100vh; background: var(--bs-body-bg); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }

/* Painel da marca */
.auth-brand {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(140deg, var(--bs-primary), #6f42c1);
}
.auth-brand::before, .auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    pointer-events: none;
}
.auth-brand::before { width: 520px; height: 520px; right: -200px; top: -160px; }
.auth-brand::after  { width: 360px; height: 360px; left: -140px; bottom: -140px; background: rgba(255, 255, 255, .07); }
.auth-brand-inner {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 3rem;
    padding: 3rem clamp(2rem, 5vw, 4rem);
}
.auth-brand-logo { height: 36px; }
.auth-brand h2 {
    font-size: clamp(1.8rem, 2.6vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.02em;
    max-width: 420px;
    margin-bottom: 2rem;
}
.auth-brand ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.auth-brand li { display: flex; align-items: center; gap: .75rem; font-size: 1.02rem; color: rgba(255, 255, 255, .9); }
.auth-brand li .material-symbols-outlined {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, .15);
    font-size: 22px;
}
.auth-brand small { color: rgba(255, 255, 255, .7); }

/* Área do formulário */
.auth-main { display: flex; flex-direction: column; padding: 1.5rem; }
.auth-top { display: flex; justify-content: flex-end; }
.auth-back {
    display: inline-flex; align-items: center; gap: .3rem;
    font-size: .9rem;
    text-decoration: none;
    color: var(--bs-secondary-color);
    padding: .4rem .75rem;
    border-radius: 999px;
}
.auth-back:hover { color: var(--bs-body-color); background: var(--bs-tertiary-bg); }
.auth-back .material-symbols-outlined { font-size: 18px; }
.auth-form-wrap { width: 100%; max-width: 420px; margin: auto; padding: 2rem 0; }

.auth-mobile-logo { display: none; margin-bottom: 2rem; }
.auth-mobile-logo img { height: 36px; }
.logo-dark { display: none; }
[data-bs-theme="dark"] .logo-light { display: none; }
[data-bs-theme="dark"] .logo-dark { display: inline; }

.auth-title { font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: .35rem; }
.auth-subtitle { color: var(--bs-secondary-color); margin-bottom: 1.75rem; }

/* Campos */
.auth-field { margin-bottom: 1rem; }
.auth-field label { display: block; font-size: .9rem; font-weight: 500; margin-bottom: .4rem; }
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; }
.auth-label-row a { font-size: .85rem; }
.auth-input { position: relative; }
.auth-input > .material-symbols-outlined {
    position: absolute;
    left: .9rem; top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--bs-secondary-color);
    pointer-events: none;
}
.auth-input .form-control {
    height: 50px;
    padding-left: 2.75rem;
    border-radius: 12px;
    background: var(--bs-body-bg);
}
.auth-input .form-control.has-toggle { padding-right: 3rem; }
.auth-input .form-control:focus {
    border-color: rgba(var(--bs-primary-rgb), .6);
    box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), .15);
}
.auth-toggle {
    position: absolute;
    right: .35rem; top: 50%;
    transform: translateY(-50%);
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--bs-secondary-color);
}
.auth-toggle:hover { background: var(--bs-tertiary-bg); color: var(--bs-body-color); }
.auth-toggle .material-symbols-outlined { font-size: 20px; }
.auth-hint { font-size: .82rem; margin-top: .35rem; color: var(--bs-secondary-color); }
.auth-hint.is-ok { color: #198754; }
.auth-hint.is-bad { color: var(--bs-danger); }
[data-bs-theme="dark"] .auth-hint.is-ok { color: #75b798; }

/* Força da senha */
.auth-strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: .5rem; }
.auth-strength span { height: 4px; border-radius: 999px; background: var(--bs-border-color); transition: background .2s; }
.auth-strength[data-level="1"] span:nth-child(-n+1) { background: #dc3545; }
.auth-strength[data-level="2"] span:nth-child(-n+2) { background: #fd7e14; }
.auth-strength[data-level="3"] span:nth-child(-n+3) { background: #20c997; }
.auth-strength[data-level="4"] span { background: #198754; }

.auth-check { font-size: .9rem; }
.auth-check .form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.auth-body a { color: var(--bs-primary); }
[data-bs-theme="dark"] .auth-body a:not(.auth-back) { color: #7cc4ff; }
.auth-body a.auth-back { color: var(--bs-secondary-color); }

/* Botão principal */
.auth-submit {
    width: 100%;
    height: 50px;
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    border: 0;
    border-radius: 999px;
    font-weight: 600;
    color: #fff;
    background: var(--bs-primary);
    box-shadow: 0 8px 20px -8px rgba(var(--bs-primary-rgb), .7);
    transition: transform .15s, filter .15s;
}
.auth-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }
.auth-submit:focus-visible { outline: 3px solid rgba(var(--bs-primary-rgb), .45); outline-offset: 2px; }
.auth-submit .material-symbols-outlined { font-size: 20px; }
.auth-submit.is-loading { opacity: .75; cursor: progress; }

/* O mesmo botão usado como link (ex.: "Voltar para o login") */
.auth-body a.auth-submit,
[data-bs-theme="dark"] .auth-body a.auth-submit { color: #fff; text-decoration: none; }

/* Telas de aviso (e-mail enviado, link expirado) */
.auth-state { margin-bottom: 1.75rem; }
.auth-state .auth-subtitle { margin-bottom: .5rem; }
.auth-state-icon {
    width: 64px; height: 64px;
    margin-bottom: 1.25rem;
    border-radius: 18px;
    display: grid; place-items: center;
    color: #198754;
    background: rgba(25, 135, 84, .12);
}
[data-bs-theme="dark"] .auth-state-icon { color: #75b798; }
.auth-state-icon .material-symbols-outlined { font-size: 34px; }
.auth-state.is-warn .auth-state-icon { color: #b76e00; background: rgba(245, 159, 0, .16); }
[data-bs-theme="dark"] .auth-state.is-warn .auth-state-icon { color: #ffc107; }

/* Tela de autorização OAuth ("Entrar com Kairoware") */
.auth-account {
    display: flex; align-items: center; gap: .9rem;
    padding: .9rem 1rem;
    margin-bottom: 1rem;
    border-radius: 14px;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-tertiary-bg);
}
.auth-account > div { flex: 1 1 auto; min-width: 0; }
.auth-account strong, .auth-account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-account small { color: var(--bs-secondary-color); }
.auth-account a { font-size: .85rem; font-weight: 600; text-decoration: none; }
.auth-scopes { margin-bottom: 1.5rem; }
.auth-scopes > p:first-child { font-size: .9rem; font-weight: 500; margin-bottom: .6rem; }
.auth-scopes ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.auth-scopes li { display: flex; align-items: center; gap: .6rem; }
.auth-scopes li .material-symbols-outlined { font-size: 20px; color: #198754; }
[data-bs-theme="dark"] .auth-scopes li .material-symbols-outlined { color: #75b798; }
.auth-scopes .auth-hint { margin-top: .9rem; }
.auth-cancel {
    width: 100%;
    height: 46px;
    margin-top: .6rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
    background: transparent;
    color: var(--bs-body-color);
    font-weight: 500;
}
.auth-cancel:hover { background: var(--bs-tertiary-bg); }
.auth-cancel:focus-visible { outline: 3px solid rgba(var(--bs-primary-rgb), .45); outline-offset: 2px; }
.auth-alt-small { font-size: .88rem; }
.auth-alt-small .material-symbols-outlined { font-size: 16px; vertical-align: -3px; }

.auth-alt { text-align: center; margin-top: 1.75rem; color: var(--bs-secondary-color); }
.auth-alt a { font-weight: 600; text-decoration: none; }

.auth-alert {
    display: flex; gap: .5rem; align-items: flex-start;
    border-radius: 12px;
    font-size: .92rem;
}
.auth-alert .material-symbols-outlined { font-size: 20px; }

@media (max-width: 991.98px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-mobile-logo { display: inline-block; }
}
