/* ============================================================
   AMSmart — telas de autenticação (out/2026)
   ------------------------------------------------------------
   Login, recuperar senha e nova senha. Mesma identidade do casco
   do cliente (am-shell.css): Figtree, grafite #222628 + ardósia,
   cantos generosos. Substitui o page-auth.css do Vuexy nessas telas.

   Estrutura (views/partials/auth-cover-inicio.php):
     .am-auth
       .am-auth-arte    ← card arredondado com a foto e a máscara
       .am-auth-lado    ← coluna do formulário (logo no topo)
   ============================================================ */

:root {
    --am-font-ui: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --bs-font-sans-serif: var(--am-font-ui);
    --bs-body-font-family: var(--am-font-ui);
    --am-r-arte: 28px;
    --am-r-ctl:  12px;
    --am-line:   #DCE3E7;
    --am-auth-bg: #FFFFFF;
    --am-auth-text: #222628;
    --am-auth-muted: #5C6970;
    --am-auth-label: #3A4348;
    --am-auth-input: #FFFFFF;
    --am-auth-seg: #EEF2F4;
    --am-auth-logo: #222628;
    --am-ease: cubic-bezier(.2,.8,.2,1);
}
[data-bs-theme='dark'] {
    --am-line:   #343C40;
    --am-auth-bg: #16191B;
    --am-auth-text: #EEF2F4;
    --am-auth-muted: #93A1A8;
    --am-auth-label: #C2CDD3;
    --am-auth-input: #1D2124;
    --am-auth-seg: #23282B;
    --am-auth-logo: #FFFFFF;
}

html, body { height: 100%; }
body.am-auth-body {
    margin: 0;
    background: var(--am-auth-bg);
    color: var(--am-auth-text);
    font-family: var(--am-font-ui);
    -webkit-font-smoothing: antialiased;
}
.am-auth-body h1, .am-auth-body h2, .am-auth-body h3,
.am-auth-body h4, .am-auth-body h5, .am-auth-body h6 {
    font-family: var(--am-font-ui);
    color: var(--am-auth-text);
}

.am-auth {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    gap: 16px;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 16px;
    box-sizing: border-box;
}

/* ── Card da arte ────────────────────────────────────────── */
.am-auth-arte {
    position: relative;
    overflow: hidden;
    border-radius: var(--am-r-arte);
    background: #222628;
    color: #fff;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    padding: clamp(28px, 4vw, 52px);
    min-height: calc(100dvh - 32px);
    box-sizing: border-box;
}
.am-auth-foto {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 28% 30%;
    z-index: -2;
}
/* Máscara escura: grafite por cima de tudo, mais fechada embaixo
   (onde fica o texto) e no topo (onde fica a marca). */
.am-auth-arte::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(22,25,27,.72) 0%, rgba(22,25,27,.30) 32%, rgba(22,25,27,.52) 58%, rgba(22,25,27,.94) 100%),
        linear-gradient(90deg, rgba(22,25,27,.55) 0%, rgba(22,25,27,0) 70%),
        rgba(34,38,40,.28);
}
.am-auth-arte-marca { display: inline-flex; color: #fff; text-decoration: none; }
.am-auth-arte-marca svg { height: 30px; width: auto; }
.am-auth-arte-texto { margin-top: auto; max-width: 36rem; }
.am-auth-arte-texto h2 {
    color: #fff;
    font-weight: 800;
    font-size: clamp(1.7rem, 2.6vw, 2.45rem);
    line-height: 1.12;
    letter-spacing: -.025em;
    margin: 0 0 .9rem;
}
.am-auth-arte-texto p {
    color: rgba(255,255,255,.78);
    font-size: 1rem;
    line-height: 1.55;
    margin: 0;
}
.am-auth-arte-itens {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 1.75rem 0 0;
    padding: 0;
    list-style: none;
}
.am-auth-arte-itens li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px 7px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.16);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    font-size: .82rem;
    font-weight: 600;
    color: rgba(255,255,255,.92);
}
.am-auth-arte-itens .ti { font-size: 1rem; opacity: .9; }

/* ── Coluna do formulário ────────────────────────────────── */
.am-auth-lado {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px clamp(16px, 4vw, 48px);
}
.am-auth-caixa { width: 100%; max-width: 400px; }

.am-auth-logo {
    display: inline-flex;
    color: var(--am-auth-logo);
    margin-bottom: 2.25rem;
}
.am-auth-logo svg { height: 34px; width: auto; }

.am-auth-titulo,
.am-auth-caixa > h4 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 0 0 .35rem;
}
.am-auth-sub,
.am-auth-caixa > h4 + p {
    color: var(--am-auth-muted);
    font-size: .95rem;
    margin: 0 0 1.75rem;
}

/* Campos, botão e alertas no padrão do casco */
.am-auth-body .form-label {
    font-weight: 600;
    font-size: .86rem;
    color: var(--am-auth-label);
    margin-bottom: .4rem;
}
.am-auth-body .form-control {
    min-height: 48px;
    border-radius: var(--am-r-ctl);
    border-color: var(--am-line);
    background-color: var(--am-auth-input);
    color: var(--am-auth-text);
    font-size: .95rem;
    padding-inline: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.am-auth-body .form-control::placeholder { color: var(--am-auth-muted); opacity: .7; }
.am-auth-body .form-control:focus {
    border-color: var(--am-auth-text);
    box-shadow: 0 0 0 4px rgba(111,124,132,.18);
}
.am-auth-body .input-group-merge .form-control { border-inline-end: 0; }
.am-auth-body .input-group-merge .input-group-text {
    border-color: var(--am-line);
    background-color: var(--am-auth-input);
    color: var(--am-auth-muted);
    border-start-end-radius: var(--am-r-ctl);
    border-end-end-radius: var(--am-r-ctl);
    padding-inline: 14px;
}
.am-auth-body .input-group-merge .form-control {
    border-start-start-radius: var(--am-r-ctl);
    border-end-start-radius: var(--am-r-ctl);
}
.am-auth-body .input-group-merge:focus-within .input-group-text { border-color: var(--am-auth-text); }
.am-auth-body .input-group-merge:focus-within {
    border-radius: var(--am-r-ctl);
    box-shadow: 0 0 0 4px rgba(111,124,132,.18);
}
.am-auth-body .input-group-merge:focus-within .form-control:focus { box-shadow: none; }
.am-auth-body .input-group-text .ti { font-size: 1.15rem; }

.am-auth-body .btn {
    --bs-btn-border-radius: 999px;
    min-height: 48px;
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: .005em;
}
.am-auth-body .btn-primary {
    box-shadow: 0 6px 16px rgba(34,38,40,.18);
    transition: transform .12s var(--am-ease), box-shadow .15s;
}
.am-auth-body .btn-primary:hover { box-shadow: 0 8px 20px rgba(34,38,40,.24); }
.am-auth-body .btn-primary:active { transform: translateY(1px); }
.am-auth-body .btn > span { display: inline-flex; align-items: center; justify-content: center; }

.am-auth-body .alert { border-radius: 14px; font-size: .88rem; }

.am-auth-link {
    color: var(--am-auth-muted);
    font-size: .86rem;
    font-weight: 600;
    text-decoration: none;
}
.am-auth-link:hover { color: var(--am-auth-text); text-decoration: underline; text-underline-offset: 3px; }

/* Seletor Portal do Cliente / Acesso Restrito */
.login-tabs {
    display: flex;
    gap: 4px;
    background: var(--am-auth-seg);
    border-radius: 999px;
    padding: 4px;
    margin-bottom: 1.5rem;
}
.login-tabs .tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    background: transparent;
    border-radius: 999px;
    padding: .6rem .75rem;
    font-size: .86rem;
    font-weight: 600;
    color: var(--am-auth-muted);
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}
.login-tabs .tab-btn:hover { color: var(--am-auth-text); }
.login-tabs .tab-btn.active {
    background: var(--am-auth-input);
    color: var(--am-auth-text);
    box-shadow: 0 1px 2px rgba(34,38,40,.08), 0 2px 8px rgba(34,38,40,.06);
}
.login-tabs .tab-btn .ti { font-size: 1rem; }

/* Rodapé legal */
.am-auth-rodape {
    margin-top: 2.25rem;
    text-align: center;
    font-size: .78rem;
    color: var(--am-auth-muted);
}
.am-auth-rodape nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 14px; margin-bottom: .45rem; }
.am-auth-rodape a { color: var(--am-auth-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.am-auth-rodape a:hover { color: var(--am-auth-text); }
.am-auth-rodape p { margin: 0; opacity: .85; }

/* ── Telas menores ───────────────────────────────────────── */
@media (max-width: 1199.98px) {
    .am-auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .am-auth-arte-itens { display: none; }
}
/* Abaixo de 992px a foto sai: só o formulário, com a marca no topo. */
@media (max-width: 991.98px) {
    .am-auth { display: block; padding: 0; }
    .am-auth-arte { display: none; }
    .am-auth-lado { min-height: 100dvh; padding: 40px 20px 28px; justify-content: flex-start; }
    .am-auth-caixa { margin-block: auto; }
    .am-auth-logo { margin-bottom: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
    .am-auth-body * { transition: none !important; }
}
