﻿/* ==========================================================================
   MOBSIM MOBX — telas de acesso (login, recuperação de senha, primeiro
   acesso, convite). Compartilhado por todas as views que usam
   ~/Views/Shared/_AuthLayout.cshtml. Mesma identidade do Admin e da área do
   cliente: cores e medidas de mobx-tokens.css, tamanhos iguais aos do tema.
   Este arquivo não carrega o Bootstrap nem o mobx-theme.css.
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body.auth {
  margin: 0; min-height: 100%;
  background: var(--mobx-bg); color: var(--mobx-text);
  font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif; font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.auth img { display: block; max-width: 100%; }
button, input { font: inherit; }
.auth [hidden] { display: none !important; }
.auth :focus-visible { outline: 2px solid var(--mobx-primary); outline-offset: 2px; border-radius: 4px; }
.auth .sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* --- Estrutura: barra superior · cartão · rodapé ---------------------------- */
.auth-page {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-rows: auto 1fr auto;
  padding-inline: clamp(16px, 4vw, 40px);
}
.auth-topbar { display: flex; align-items: center; justify-content: flex-end; padding-block: 14px 0; }
.auth-center { display: grid; place-items: center; padding-block: 20px 32px; }

.auth-card {
  width: 100%; max-width: 448px;
  display: grid; gap: 18px;
  padding: 28px;
  background: var(--mobx-surface);
  border: 1px solid var(--mobx-border);
  border-radius: var(--mobx-radius-lg);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.auth-card--wide { max-width: 500px; }

/* --- Logotipo --------------------------------------------------------------- */
.auth-logo { justify-self: start; display: inline-flex; }
/* O SVG é branco - brightness(0) deixa preto. */
.auth-logo img { height: 22px; width: auto; filter: brightness(0); }

/* --- Barra superior ---------------------------------------------------------- */
.auth-help-link { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--mobx-muted); font-size: 13px; text-decoration: none; }
.auth-help-link:hover { color: var(--mobx-primary-hover); }
.auth-help-link .label-short { display: none; }

/* --- Corpo da view ------------------------------------------------------------ */
.auth-view { display: grid; gap: 18px; min-width: 0; }

/* Título ao lado do ícone: mesmo círculo do Acesso rápido, na proporção do título. */
.auth-head { display: flex; align-items: flex-start; gap: 14px; }
.auth-head > .auth-view__head { flex: 1; min-width: 0; }
.auth-head__icon { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f3f4f6; color: #4b5563; font-size: 22px; }
.auth-head__icon--ok { background: #f0fdf4; color: #166534; }
.auth-head__icon--warn { background: #fffbeb; color: #92400e; }
.auth-head__icon--info { background: var(--mobx-primary-soft); color: #1e40af; }

.auth-view__head { display: grid; gap: 4px; }
.auth-view__title { margin: 0; color: var(--mobx-heading); font-size: 26px; font-weight: 600; line-height: 1.25; text-wrap: balance; }
.auth-view__title:focus { outline: none; }
.auth-view__sub { margin: 0; color: var(--mobx-muted); font-size: 14px; text-wrap: pretty; }
.auth-view__sub strong { color: var(--mobx-heading); font-weight: 600; word-break: break-word; }
.auth-view__sub + .auth-view__sub { margin-top: -8px; }
.auth-badge { justify-self: start; display: inline-block; padding: 3px 9px; border-radius: 999px; background: #f3f4f6; color: #4b5563; font-size: 12px; font-weight: 600; }

.auth-back { justify-self: start; display: inline-flex; align-items: center; gap: 6px; color: var(--mobx-primary); font-size: 13px; text-decoration: none; }
.auth-back:hover { color: var(--mobx-primary-hover); text-decoration: underline; }

/* --- Passos (primeiro acesso), como as abas do sa-steps ---------------------- */
.auth-steps { display: flex; flex-wrap: wrap; gap: 4px 18px; border-bottom: 1px solid var(--mobx-border); font-size: 13px; color: var(--mobx-muted); }
.auth-steps span { margin-bottom: -1px; padding-bottom: 8px; }
.auth-steps span.is-active { border-bottom: 2px solid var(--mobx-primary); color: var(--mobx-primary); font-weight: 600; }
.auth-steps span.is-sep { display: none; }

/* --- Campos ------------------------------------------------------------------- */
.auth-form { display: grid; gap: 14px; }
.auth-field { display: grid; gap: 5px; min-width: 0; }
.auth-field__foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px 12px; }
.auth-field__msgs { display: grid; gap: 4px; min-width: 0; }
.auth-field__foot .auth-link { margin-left: auto; flex: none; }
.auth-label { color: var(--mobx-heading); font-size: 13px; font-weight: 600; }
.auth-link { padding: 0; border: 0; background: none; cursor: pointer; color: var(--mobx-primary); font-size: 13px; text-decoration: none; }
.auth-link:hover { color: var(--mobx-primary-hover); text-decoration: underline; }

.auth-control { position: relative; display: flex; align-items: center; }
.auth-control__icon { position: absolute; left: 12px; color: #9ca3af; font-size: 13px; pointer-events: none; }
.auth-input {
  width: 100%; height: 38px; padding: 0 12px 0 34px;
  border: 1px solid var(--mobx-input-border); border-radius: var(--mobx-radius);
  background: var(--mobx-surface); color: var(--mobx-heading); font-size: 14px;
}
.auth-input::placeholder { color: #9ca3af; opacity: 1; }
.auth-input:focus { outline: none; border-color: var(--mobx-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.auth-input.input-validation-error { border-color: #dc2626; }
.auth-input.input-validation-error:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }
.auth-input--password { padding-right: 40px; }
.auth-input--code { padding-left: 34px; font-size: 18px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.auth-input:-webkit-autofill, .auth-input:-webkit-autofill:hover, .auth-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--mobx-heading); -webkit-box-shadow: 0 0 0 1000px var(--mobx-surface) inset; caret-color: var(--mobx-heading);
}

.auth-reveal { position: absolute; right: 4px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--mobx-muted); font-size: 13px; cursor: pointer; }
.auth-reveal:hover { background: #f3f4f6; color: var(--mobx-heading); }
.auth-reveal .eye-off { display: none; }
.auth-reveal[aria-pressed="true"] .eye-on { display: none; }
.auth-reveal[aria-pressed="true"] .eye-off { display: block; }

.auth-hint { margin: 0; font-size: 12px; color: var(--mobx-muted); }
.auth-msg { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 12px; }
.auth-msg--error, .auth .field-validation-error { color: #b91c1c; font-size: 12px; }
.auth-msg--warn { align-items: center; color: #92400e; }
.auth .field-validation-valid { display: none; }

.auth-check { justify-self: start; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; user-select: none; }
.auth-check--terms { align-items: flex-start; }
.auth-check input { flex: none; width: 15px; height: 15px; margin: 0; accent-color: var(--mobx-primary); cursor: pointer; }
.auth-check--terms input { margin-top: 3px; }
.auth-check a { color: var(--mobx-primary); text-decoration: none; }
.auth-check a:hover { text-decoration: underline; }

.auth-note { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 9px; padding: 10px 12px; border: 1px solid #bfdbfe; border-radius: var(--mobx-radius); background: var(--mobx-primary-soft); color: #1e40af; font-size: 13px; }
.auth-note i { margin-top: 3px; }
.auth-note p { margin: 0; }
.auth-note strong { font-weight: 600; }
.auth-fineprint { margin: 0; font-size: 12px; color: var(--mobx-muted); }

/* --- Botões, como o btn-primary e o btn-default do tema -------------------------- */
.auth-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 12px; border-top: 1px solid #f0f1f3; }
.auth-actions .auth-btn-ghost { flex: 1 1 auto; }
.auth-actions .auth-btn { flex: 1 1 55%; width: auto; }

.auth-btn, .auth-btn-ghost { display: flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: var(--mobx-radius); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
.auth-btn { width: 100%; border: 1px solid var(--mobx-primary); background: var(--mobx-primary); color: #fff; }
.auth-btn:hover { border-color: var(--mobx-primary-hover); background: var(--mobx-primary-hover); color: #fff; }
.auth-btn[disabled] { opacity: .6; cursor: default; }
.auth-btn-ghost { border: 1px solid var(--mobx-input-border); background: var(--mobx-surface); color: #374151; }
.auth-btn-ghost:hover { background: var(--mobx-subtle); border-color: #9ca3af; color: #374151; }

/* --- Avisos, nas cores do alert-danger e do alert-success do tema ---------------- */
.auth-alert { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 9px; padding: 10px 12px; border: 1px solid #fecaca; border-radius: var(--mobx-radius); background: #fef2f2; color: #991b1b; font-size: 13px; }
.auth-alert i { margin-top: 3px; }
.auth-alert p { margin: 0; }
.auth-alert strong { font-weight: 600; }
.auth-alert--positive { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }

/* Html.ValidationSummary do MVC - sem markup próprio pra injetar ícone, então o
   "alerta" vem só da cor/borda/fundo. Usada com excludePropertyErrors:true em
   toda tela (só mostra erro de nível de formulário, ex.: "usuário ou senha
   incorretos" - erro de campo específico já aparece inline via ValidationMessageFor). */
.auth .validation-summary-errors { padding: 10px 12px; border: 1px solid #fecaca; border-radius: var(--mobx-radius); background: #fef2f2; color: #991b1b; font-size: 13px; }
.auth .validation-summary-errors ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.auth .validation-summary-valid { display: none; }

.auth-alt, .auth-resend { margin: 0; text-align: center; font-size: 13px; color: var(--mobx-muted); }
.auth-resend { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.tnum { font-variant-numeric: tabular-nums; }

/* --- Rodapé ---------------------------------------------------------------------- */
.auth-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 14px; padding-block: 0 16px; font-size: 12px; color: var(--mobx-muted); }
.auth-foot p { margin: 0; }
.auth-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.auth-foot a { color: var(--mobx-muted); text-decoration: none; }
.auth-foot a:hover { color: var(--mobx-primary-hover); text-decoration: underline; }

/* --- Responsivo -------------------------------------------------------------------- */
@media (max-width: 520px) {
  .auth-center { place-items: start center; padding-block: 8px 24px; }
  .auth-card { padding: 20px; }
  /* Com menos de 16px o iPhone dá zoom ao focar o campo. */
  .auth-input { font-size: 16px; }
  .auth-input--code { font-size: 18px; }
  .auth-help-link .label-long { display: none; }
  .auth-help-link .label-short { display: inline; }
}
