/* Telas de autenticação (login, recuperação de senha) — GestorPúblico BI.
   As cores --gp-primary/--gp-dark são sobrescritas inline pela página (branding do tenant). */
:root {
    --gp-primary: #2563eb;
    --gp-dark: #0f172a;
    --gp-bg: #eef2f7;
    --gp-card: #ffffff;
    --gp-ink: #0f172a;
    --gp-muted: #64748b;
    --gp-line: #e2e8f0;
    --gp-red: #dc2626;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 16px; background: var(--gp-bg); color: var(--gp-ink);
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 15px;
}
.gp-shell {
    width: 100%; max-width: 920px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: var(--gp-card); border-radius: 18px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(15,23,42,.06), 0 20px 48px rgba(15,23,42,.12);
    animation: gpIn .5s ease-out;
}
@keyframes gpIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Painel da marca */
.gp-brand {
    position: relative; padding: 48px 40px; color: #fff; display: flex; flex-direction: column;
    justify-content: space-between; gap: 32px; overflow: hidden;
    background: var(--gp-dark);
    background: linear-gradient(150deg, var(--gp-dark) 0%, color-mix(in srgb, var(--gp-primary) 55%, var(--gp-dark)) 100%);
}
.gp-brand::after {
    content: ""; position: absolute; right: -80px; bottom: -80px; width: 260px; height: 260px;
    border-radius: 50%; background: var(--gp-primary); opacity: .25; filter: blur(10px);
}
.gp-mark { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.gp-mark img { width: 44px; height: 44px; border-radius: 10px; }
.gp-mark strong { display: block; font-size: 18px; letter-spacing: .2px; }
.gp-mark span { display: block; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; opacity: .7; }
.gp-pitch { position: relative; z-index: 1; }
.gp-pitch h2 { font-size: 26px; line-height: 1.25; font-weight: 700; margin-bottom: 12px; }
.gp-pitch p { opacity: .8; line-height: 1.55; }
.gp-bars { display: flex; align-items: flex-end; gap: 8px; height: 64px; margin-top: 28px; }
.gp-bars i { display: block; width: 14px; border-radius: 3px 3px 0 0; background: #fff; }
.gp-foot { position: relative; z-index: 1; font-size: 12px; opacity: .6; }

/* Formulário */
.gp-form { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
.gp-form h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.gp-sub { color: var(--gp-muted); margin-bottom: 28px; }
.gp-tenant {
    align-self: flex-start; margin-bottom: 16px; padding: 4px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; color: var(--gp-primary);
    background: color-mix(in srgb, var(--gp-primary) 10%, transparent);
}
.gp-field { margin-bottom: 18px; }
.gp-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.gp-input { position: relative; }
.gp-input > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--gp-muted); pointer-events: none; }
.gp-input input {
    width: 100%; padding: 12px 42px 12px 40px; font: inherit; color: var(--gp-ink);
    border: 1px solid var(--gp-line); border-radius: 10px; background: #f8fafc;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.gp-input input:focus {
    outline: none; background: #fff; border-color: var(--gp-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--gp-primary) 18%, transparent);
}
.gp-input input.is-invalid { border-color: var(--gp-red); }
.gp-eye {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none;
    padding: 6px; cursor: pointer; color: var(--gp-muted); display: flex;
}
.gp-eye:hover { color: var(--gp-primary); }
.gp-eye svg { width: 18px; height: 18px; }
.hidden { display: none !important; }
.gp-row { display: flex; justify-content: flex-end; margin: -4px 0 22px; }
.gp-row a { font-size: 13px; font-weight: 600; color: var(--gp-primary); text-decoration: none; }
.gp-row a:hover { text-decoration: underline; }
.gp-btn {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 16px; border: 0; border-radius: 10px; cursor: pointer;
    font: inherit; font-weight: 600; color: #fff; background: var(--gp-primary);
    transition: filter .15s, transform .15s;
}
.gp-btn:hover { filter: brightness(1.08); }
.gp-btn:active { transform: scale(.99); }
.gp-btn:disabled { opacity: .7; cursor: wait; }
.gp-btn svg { width: 18px; height: 18px; }
.gp-spin { animation: gpSpin 1s linear infinite; }
@keyframes gpSpin { to { transform: rotate(360deg); } }

.gp-alert { display: flex; align-items: center; gap: 8px; padding: 12px 14px; margin-bottom: 20px; border-radius: 10px; font-size: 14px; transition: opacity 1s; }
.gp-alert svg { width: 18px; height: 18px; flex: none; }
.gp-alert.error-bg { color: #991b1b; background: #fef2f2; border: 1px solid #fecaca; }
.gp-alert.success-bg { color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; }
.fade-out { opacity: 0; }
.gp-copy { margin-top: 28px; font-size: 12px; color: var(--gp-muted); text-align: center; }

@media (max-width: 760px) {
    .gp-shell { grid-template-columns: minmax(0, 1fr); }
    .gp-brand { padding: 28px 24px; gap: 16px; }
    .gp-pitch h2 { font-size: 20px; }
    .gp-bars, .gp-foot { display: none; }
    .gp-form { padding: 32px 24px; }
}

/* ---------- Componentes das telas de verificação e recuperação ---------- */
.gp-center { text-align: center; }
.gp-icon {
    width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--gp-primary); background: #eff6ff;
    background: color-mix(in srgb, var(--gp-primary) 10%, transparent);
}
.gp-icon svg { width: 26px; height: 26px; }
.gp-icon.ok { color: #16a34a; background: #f0fdf4; }
.gp-codes { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; }
.gp-codes input {
    width: 46px; height: 54px; text-align: center; font: inherit; font-size: 22px; font-weight: 700;
    color: var(--gp-ink); background: #f8fafc; border: 1px solid var(--gp-line); border-radius: 10px;
    transition: border-color .2s, box-shadow .2s;
}
.gp-codes input:focus, .gp-code-single:focus {
    outline: none; background: #fff; border-color: var(--gp-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--gp-primary) 18%, transparent);
}
.gp-code-single {
    width: 100%; padding: 12px; margin-bottom: 20px; font: inherit; font-size: 18px; text-align: center;
    letter-spacing: .15em; text-transform: uppercase; color: var(--gp-ink);
    background: #f8fafc; border: 1px solid var(--gp-line); border-radius: 10px;
}
.gp-destino {
    padding: 12px 14px; margin-bottom: 20px; font-size: 14px; line-height: 1.6; text-align: left;
    background: #f8fafc; border: 1px solid var(--gp-line); border-radius: 10px;
}
.gp-destino .label { color: var(--gp-muted); font-size: 12px; text-transform: uppercase; }
.gp-msg { display: none; padding: 10px 12px; margin-bottom: 16px; border-radius: 10px; font-size: 14px; }
.gp-msg.erro { color: #991b1b; background: #fef2f2; border: 1px solid #fecaca; }
.gp-msg.ok { color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; }
.gp-link {
    display: inline-block; margin-top: 14px; padding: 0; border: 0; background: none; cursor: pointer;
    font: inherit; font-size: 13px; font-weight: 600; color: var(--gp-primary); text-decoration: none;
}
.gp-link:hover { text-decoration: underline; }
.gp-link:disabled { color: var(--gp-muted); cursor: not-allowed; text-decoration: none; }
.gp-link.muted { color: var(--gp-muted); font-weight: 500; }
.gp-timer { margin-top: 6px; font-size: 12px; color: var(--gp-muted); }
.gp-hint { margin-top: 6px; font-size: 12px; color: var(--gp-muted); }
.gp-info {
    padding: 12px 14px; margin-bottom: 20px; font-size: 13px; line-height: 1.55;
    color: #1e3a8a; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px;
}
.gp-info ul { margin: 6px 0 0 18px; }
.gp-steps { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.gp-step {
    width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: var(--gp-muted); border: 2px solid var(--gp-line); background: #fff;
}
.gp-step.ativo { color: #fff; background: var(--gp-primary); border-color: var(--gp-primary); }
.gp-step.feito { color: var(--gp-primary); border-color: var(--gp-primary); }
.gp-step-bar { flex: 1; height: 3px; border-radius: 2px; background: var(--gp-line); overflow: hidden; }
.gp-step-bar i { display: block; height: 100%; background: var(--gp-primary); }
.gp-step-label { font-size: 12px; color: var(--gp-muted); }
.backup-mode { display: none; }
.backup-mode.active { display: block; }
