/*
 * auth.css — Fluxo de autenticação do ITR Fácil
 * Compartilhado por: login, cadastro, esqueci_a_senha, nova_senha
 */

/* ── base ── */
html { height: 100%; }

body {
    min-height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background: #f0f2f4;
    color: #1f2937;
}

body.auth-flex {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ── topbar mínima ── */
.auth-topbar {
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    padding: .5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.auth-topbar img { height: 38px; }

.auth-topbar-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: color .13s;
}
.auth-topbar-back:hover { color: #17A2B8; }

/* ── main ── */
.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

body.auth-flex .auth-main { flex: 1; }

.auth-main--top {
    align-items: flex-start;
    padding-bottom: 3rem;
}

/* ── card ── */
.auth-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 32px rgba(0,0,0,.10), 0 1px 4px rgba(0,0,0,.06);
    overflow: hidden;
}

.auth-card--wide { max-width: 560px; }

/* ── topo do card ── */
.auth-card-top {
    position: relative;
    background: linear-gradient(135deg, #082c37 0%, #0d6476 50%, #17A2B8 100%);
    padding: 2rem 2rem 1.75rem;
    text-align: center;
    overflow: hidden;
}

.auth-card-top--compact { padding: 1.5rem 2rem; }

.auth-card-top::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
}

.auth-card-top::after {
    content: '';
    position: absolute;
    top: -80px;
    right: -60px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 65%);
    pointer-events: none;
}

/* logo */
.auth-logo {
    position: relative;
    z-index: 1;
    margin-bottom: 1rem;
}
.auth-logo img         { height: 52px; }
.auth-logo--sm img     { height: 44px; }

/* ícone circular */
.auth-icon-wrap {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    border: 2px solid rgba(255,255,255,.2);
    color: #fff;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.auth-card-title {
    position: relative;
    z-index: 1;
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.02em;
    margin: 0 0 .3rem;
}
.auth-card-title--sm { font-size: 1.05rem; }

.auth-card-subtitle {
    position: relative;
    z-index: 1;
    font-size: .775rem;
    color: rgba(255,255,255,.65);
    margin: 0;
}

/* ── corpo ── */
.auth-card-body { padding: 1.75rem 1.75rem 1.5rem; }

/* ── label e campo genérico ── */
.auth-label {
    display: block;
    font-size: .775rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.auth-field {
    width: 100%;
    padding: .45rem .65rem;
    font-size: .8125rem;
    font-family: 'Inter', sans-serif;
    border: 1px solid rgba(0,0,0,.14);
    border-radius: 8px;
    background: #f9fafb;
    color: #1f2937;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
    box-sizing: border-box;
}
.auth-field::placeholder { color: #9ca3af; }
.auth-field:focus {
    border-color: #17A2B8;
    box-shadow: 0 0 0 3px rgba(23,162,184,.15);
    background: #fff;
}
.auth-field:disabled { background: #f3f4f6; color: #9ca3af; cursor: not-allowed; }

/* select dentro de auth-field */
.auth-field[multiple],
.auth-field select,
select.auth-field { cursor: pointer; }

/* campo com ícone à esquerda */
.auth-input-wrap {
    position: relative;
    margin-bottom: 1rem;
}

.auth-input-wrap .auth-fi {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: .8rem;
    pointer-events: none;
}

.auth-input-wrap .auth-field { padding-left: 2.1rem; }

/* grupo tipo-usuário */
.auth-tipo-group {
    display: flex;
    gap: .4rem;
    margin-bottom: 1.1rem;
}
.auth-tipo-group .auth-field { cursor: pointer; }

/* grupo inline (CEP + botão) */
.auth-input-group { display: flex; gap: .5rem; }
.auth-input-group .auth-field { flex: 1; }

/* ── alertas ── */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: .775rem;
    padding: .6rem .85rem;
    border-radius: 7px;
    margin-bottom: 1rem;
    background: rgba(220,53,69,.08);
    border: 1px solid rgba(220,53,69,.2);
    color: #842029;
}

.auth-field-error {
    font-size: .72rem;
    color: #dc3545;
    margin-top: 2px;
    margin-bottom: .5rem;
    padding-left: 2px;
    display: block;
}

.auth-help {
    font-size: .72rem;
    color: #6b7280;
    margin-top: 3px;
    display: block;
}

/* aviso caps lock */
.auth-caps-hint {
    display: none;
    font-size: .72rem;
    color: #d97706;
    margin-top: -0.6rem;
    margin-bottom: .75rem;
    padding-left: 2px;
}
.auth-caps-hint.visible { display: block; }

/* ── botões ── */
.btn-auth-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: .575rem 1rem;
    font-size: .875rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border: none;
    border-radius: 8px;
    background: #17A2B8;
    color: #fff;
    cursor: pointer;
    transition: background .13s;
    margin-top: .25rem;
}
.btn-auth-primary:hover { background: #138a9c; }

.btn-auth-secondary {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: .55rem .85rem;
    font-size: .8rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    border: 1px solid rgba(0,0,0,.14);
    border-radius: 8px;
    background: #fff;
    color: #374151;
    text-decoration: none;
    transition: background .13s, border-color .13s;
}
.btn-auth-secondary:hover { background: #f3f4f6; border-color: rgba(0,0,0,.2); color: #111; }

.btn-auth-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: .45rem .85rem;
    font-size: .775rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    background: rgba(23,162,184,.1);
    color: #17A2B8;
    border: 1px solid rgba(23,162,184,.3);
    border-radius: 8px;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: background .13s, border-color .13s;
}
.btn-auth-inline:hover { background: rgba(23,162,184,.18); border-color: #17A2B8; color: #17A2B8; }

/* grupo de ações com borda superior */
.auth-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0,0,0,.07);
}

/* variante sem borda (ex: esqueci_a_senha) */
.auth-actions--bare {
    margin-top: .5rem;
    padding-top: 0;
    border-top: none;
}

.auth-actions .btn-auth-primary,
.auth-actions--bare .btn-auth-primary {
    flex: 1;
    margin-top: 0;
}

/* ── separadores ── */
.auth-divider {
    margin: 1.25rem 0;
    border: none;
    border-top: 1px solid rgba(0,0,0,.07);
}

/* ── links abaixo do form (login) ── */
.auth-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .4rem;
}

.auth-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .775rem;
    color: #6b7280;
    text-decoration: none;
    transition: color .12s;
}
.auth-link:hover { color: #17A2B8; }

/* ── separador de seção com linha (cadastro) ── */
.auth-section {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #17A2B8;
    margin: 1.25rem 0 .75rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.auth-section::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(23,162,184,.2);
}
.auth-section:first-child { margin-top: 0; }

/* ── select2 (cadastro) ── */
.select2-container--default .select2-selection--single {
    height: auto !important;
    padding: .45rem .65rem !important;
    font-size: .8125rem !important;
    font-family: 'Inter', sans-serif !important;
    border: 1px solid rgba(0,0,0,.14) !important;
    border-radius: 8px !important;
    background: #f9fafb !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 1.4 !important;
    padding: 0 !important;
    color: #1f2937 !important;
    font-size: .8125rem !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 50% !important;
    transform: translateY(-50%);
}
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #17A2B8 !important;
    box-shadow: 0 0 0 3px rgba(23,162,184,.15) !important;
}
.select2-dropdown {
    font-size: .8125rem !important;
    font-family: 'Inter', sans-serif !important;
    border-radius: 8px !important;
}
.select2-container--default .select2-results__option--highlighted {
    background: #17A2B8 !important;
}

/* ── rodapé mínimo ── */
.auth-foot {
    flex-shrink: 0;
    padding: .45rem 1.5rem;
    font-size: .7rem;
    color: #9ca3af;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,.07);
    text-align: center;
}
.auth-foot a { color: #17A2B8; text-decoration: none; }
