﻿/* ==========================================================================
   MOBSIM MOBX — telas de acesso (login, recuperação de senha, primeiro
   acesso, convite). Compartilhado por todas as views que usam
   ~/Views/Shared/_AuthLayout.cshtml.

   Tokens: escuro #140c14 · destaque (com moderação) #44fce4 · claro #fff
   ========================================================================== */
:root {
  --dark: #140c14;
  --accent: #44fce4;
  --white: #FFFFFF;

  --page: var(--dark);
  --page-text: var(--white);
  --page-muted: #B3AFB3;
  --page-hover: rgba(255, 255, 255, .07);

  --card: var(--white);
  --card-shadow: 0 40px 90px -40px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .06);
  --card-border: #ECE9EC;
  --text: var(--dark);
  --muted: #625B62;
  --field-bg: var(--white);
  --field-border: #8A838A;
  --field-border-hover: var(--dark);
  --focus-ring: rgba(68, 252, 228, .55);
  --btn-bg: var(--dark);
  --btn-text: var(--white);
  --btn-shadow: 0 14px 30px -14px rgba(20, 12, 20, .55);
  --chip-bg: var(--accent);
  --chip-fg: var(--dark);
  --check-bg: var(--dark);
  --check-fg: var(--accent);
  --hover-bg: rgba(20, 12, 20, .05);
  --danger: #B3261E;
  --danger-bg: #FDF0F0;
  --danger-line: #F1C6C8;
  --warn: #7A4B00;
  --warn-bg: #FFF4DE;
  --note-bg: rgba(68, 252, 228, .14);
  --note-line: rgba(20, 12, 20, .12);
  --success-bg: linear-gradient(135deg, #1f7a4a, #144a2f);
  --mark: rgba(68, 252, 228, .45);

  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body.auth {
  margin: 0; min-height: 100%;
  background: var(--page); color: var(--page-text);
  font-family: var(--font-body); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.auth img, .auth svg { display: block; max-width: 100%; }
.auth button, .auth input { font: inherit; }
.auth [hidden] { display: none !important; }
.auth :focus-visible { outline: 2px solid var(--page-text); outline-offset: 3px; border-radius: 6px; }
.auth .card :focus-visible { outline-color: var(--text); }
.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; }
.auth .ic { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; width: 20px; height: 20px; }

/* --- Estrutura: barra superior · caixa de login · 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; gap: 8px; padding-block: 20px 0; min-height: 64px; }
.auth-center { display: grid; place-items: center; padding-block: 24px 40px; }

.auth-card {
  width: 100%; max-width: 448px;
  display: grid; gap: 28px;
  padding: clamp(28px, 5vw, 44px);
  background: var(--card);
  color: var(--text);
  border: 0;
  border-radius: 22px;
  box-shadow: var(--card-shadow);
  animation: auth-view-in .4s var(--ease) both;
}
.auth-card--wide { max-width: 500px; }

/* --- Logotipo --------------------------------------------------------------- */
.auth-logo { justify-self: start; display: inline-flex; align-items: center; min-height: 40px; color: var(--text); text-decoration: none; border-radius: 8px; }
.auth-logo img { height: 30px; width: auto; max-width: 190px; object-fit: contain; filter: brightness(0); }
.auth-logo__fallback { display: none; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: .04em; }
.auth-logo__fallback::before { content: ""; width: 11px; height: 11px; border-radius: 4px 4px 4px 1px; background: var(--accent); }
.auth-logo.is-fallback img { display: none; }
.auth-logo.is-fallback .auth-logo__fallback { display: inline-flex; }

/* --- Barra superior ---------------------------------------------------------- */
.auth-help-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px;
  border-radius: 999px; color: var(--page-muted); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: color .2s, background .2s;
}
.auth-help-link:hover { color: var(--page-text); background: var(--page-hover); }

/* --- Corpo da view ------------------------------------------------------------ */
.auth-view { display: grid; gap: 26px; }
.auth-view__head { display: grid; gap: 8px; }
.auth-view__title {
  margin: 0; font-family: var(--font-display); font-weight: 500;
  font-size: clamp(21px, 3vw, 26px); line-height: 1.2; letter-spacing: -.02em; text-wrap: balance;
}
.auth-view__title:focus { outline: none; }
.auth-view__sub { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; text-wrap: pretty; }
.auth-view__sub strong { color: var(--text); font-weight: 600; word-break: break-word; }
.auth-view__sub + .auth-view__sub { margin-top: -8px; }
.auth-accent-mark { box-shadow: inset 0 -.38em 0 var(--mark); color: var(--text); font-weight: 600; }
.auth-badge {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px;
  border-radius: 999px; background: var(--hover-bg); color: var(--muted); font-size: 11.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}

.auth-back {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 36px;
  margin: -6px 0 -6px -8px; padding: 0 10px 0 6px; border: 0; border-radius: 999px; background: none;
  color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none;
}
.auth-back:hover { color: var(--text); background: var(--hover-bg); }

/* --- Passos (primeiro acesso) ------------------------------------------------- */
.auth-steps { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; color: var(--muted); }
.auth-steps span.is-active { color: var(--text); font-weight: 700; }
.auth-steps span.is-sep { color: var(--card-border); }

/* --- Campos ------------------------------------------------------------------- */
.auth-form { display: grid; gap: 18px; }
.auth-field { display: grid; gap: 8px; }
.auth-field__foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.auth-field__msgs { display: grid; gap: 6px; min-width: 0; }
.auth-field__foot .auth-link { margin-left: auto; flex: none; line-height: 1.4; }
.auth-label { font-size: 14px; font-weight: 600; }
.auth-link {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--text); font-size: 14px; font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.auth-link:hover { text-decoration-color: currentColor; }

.auth-control { position: relative; display: flex; align-items: center; }
.auth-control__icon { position: absolute; left: 15px; color: var(--muted); pointer-events: none; transition: color .2s; }
.auth-input {
  width: 100%; height: 52px; padding: 0 16px 0 46px;
  border: 1px solid var(--field-border); border-radius: 12px;
  background: var(--field-bg); color: var(--text); font-size: 16px;
  transition: border-color .15s, box-shadow .2s, background-color .25s;
}
.auth-input::placeholder { color: var(--muted); opacity: .85; }
.auth-input:hover { border-color: var(--field-border-hover); }
.auth-input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 4px var(--focus-ring); }
.auth-control:focus-within .auth-control__icon { color: var(--text); }
.auth-input.input-validation-error { border-color: var(--danger); }
.auth-input.input-validation-error:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 22%, transparent); }
.auth-control:has(.input-validation-error) .auth-control__icon { color: var(--danger); }
.auth-input--password { padding-right: 56px; }
.auth-input--code { font-size: 24px; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; padding-left: 16px; }
.auth-input:-webkit-autofill, .auth-input:-webkit-autofill:hover, .auth-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text); -webkit-box-shadow: 0 0 0 1000px var(--field-bg) inset; caret-color: var(--text);
}

.auth-reveal {
  position: absolute; right: 6px; width: 42px; height: 42px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer;
  transition: color .2s, background .2s;
}
.auth-reveal:hover { color: var(--text); background: var(--hover-bg); }
.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: 13px; color: var(--muted); }
.auth-msg { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 13.5px; line-height: 1.4; }
.auth-msg svg { flex: none; margin-top: 1px; width: 16px; height: 16px; }
.auth-msg--error, .auth .field-validation-error { color: var(--danger); }
.auth-msg--warn { justify-self: start; padding: 4px 10px 4px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-weight: 500; }
.auth .field-validation-valid { display: none; }

.auth-check { justify-self: start; display: inline-flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; font-size: 15px; user-select: none; }
.auth-check--terms { align-items: flex-start; font-size: 13px; color: var(--muted); line-height: 1.5; gap: 10px; }
.auth-check input {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none;
  width: 20px; height: 20px; border: 1.5px solid var(--field-border); border-radius: 6px;
  background: var(--field-bg); display: grid; place-content: center; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.auth-check--terms input { margin-top: 2px; }
.auth-check input::before {
  content: ""; width: 11px; height: 11px; transform: scale(0); transition: transform .15s var(--ease);
  background: var(--check-fg); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.auth-check input:checked { background: var(--check-bg); border-color: var(--check-bg); }
.auth-check input:checked::before { transform: scale(1); }
.auth-check a { color: var(--text); text-decoration-color: var(--accent); }

.auth-note {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 12px 14px; border-radius: 12px; background: var(--note-bg); border: 1px solid var(--note-line);
  font-size: 13px; line-height: 1.5; color: var(--text);
}
.auth-note svg { width: 18px; height: 18px; margin-top: 1px; }
.auth-note p { margin: 0; }
.auth-fineprint { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; }

/* --- Botões -------------------------------------------------------------------- */
.auth-actions { display: flex; gap: 10px; margin-top: 4px; }
.auth-actions .auth-btn, .auth-actions .auth-btn-ghost { flex: 1; }

.auth-btn {
  position: relative; width: 100%; height: 56px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  border: 0; border-radius: 12px; background: var(--btn-bg); color: var(--btn-text);
  font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: box-shadow .25s, transform .15s var(--ease), background-color .25s, color .25s;
}
.auth-btn:hover { box-shadow: var(--btn-shadow); color: var(--btn-text); }
.auth-btn:active { transform: translateY(1px) scale(.995); }
.auth-btn[disabled] { opacity: .6; cursor: default; box-shadow: none; }
.auth-btn__chip {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 999px;
  background: var(--chip-bg); color: var(--chip-fg); transition: transform .3s var(--ease);
}
.auth-btn__chip svg { width: 16px; height: 16px; }
.auth-btn:hover .auth-btn__chip { transform: translateX(3px); }

.auth-btn-ghost {
  display: flex; align-items: center; justify-content: center; height: 56px;
  border: 1px solid var(--field-border); border-radius: 12px; background: transparent; color: var(--text);
  font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: border-color .2s, background .2s;
}
.auth-btn-ghost:hover { border-color: var(--field-border-hover); background: var(--hover-bg); color: var(--text); }

/* --- Avisos -------------------------------------------------------------------- */
.auth-alert {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 14px 16px; border: 1px solid var(--danger-line); border-radius: 12px;
  background: var(--danger-bg); font-size: 14px; line-height: 1.5;
}
.auth-alert svg { width: 20px; height: 20px; color: var(--danger); margin-top: 1px; }
.auth-alert p { margin: 0; }
.auth-alert--positive { border-color: transparent; background: var(--note-bg); }
.auth-alert--positive svg { color: var(--text); }

/* 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 {
  margin: 0; padding: 14px 16px; border: 1px solid var(--danger-line); border-radius: 12px;
  background: var(--danger-bg); color: var(--danger); font-size: 14px; line-height: 1.5;
}
.auth .validation-summary-errors ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.auth .validation-summary-valid { display: none; }

.auth-alt { margin: 0; padding-top: 22px; border-top: 1px solid var(--card-border); text-align: center; font-size: 14.5px; color: var(--muted); }
.auth-alt .auth-link { font-size: 14.5px; }

.auth-resend { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.tnum { font-variant-numeric: tabular-nums; }

/* --- Estado de sucesso ---------------------------------------------------------- */
.auth-badge-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--success-bg); color: var(--white); }
.auth-badge-icon svg { width: 26px; height: 26px; }
.auth-badge-icon--neutral { background: var(--dark); color: var(--accent); }

/* --- Rodapé ---------------------------------------------------------------------- */
.auth-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 22px;
  padding-block: 0 24px; font-size: 13px; color: var(--page-muted);
}
.auth-foot p { margin: 0; }
.auth-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.auth-foot a { color: var(--page-muted); text-decoration: none; border-radius: 4px; }
.auth-foot a:hover { color: var(--page-text); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* --- Animações ------------------------------------------------------------------- */
@keyframes auth-view-in { from { transform: translateY(8px); opacity: .01; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .auth *, .auth *::before, .auth *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* --- Responsivo -------------------------------------------------------------------- */
@media (max-width: 520px) {
  .auth-topbar { padding-block: 12px 0; }
  .auth-center { place-items: start center; padding-block: 8px 32px; }
  .auth-card { padding: 24px 20px; gap: 22px; border-radius: 18px; }
  .auth-help-link .label-long { display: none; }
  .auth-actions { flex-direction: column; }
}
.auth-help-link .label-short { display: none; }
@media (max-width: 520px) { .auth-help-link .label-short { display: inline; } }

@media (max-height: 860px) and (min-width: 521px) {
  .auth-topbar { padding-block: 12px 0; min-height: 52px; }
  .auth-center { padding-block: 8px 20px; }
  .auth-card { gap: 20px; padding-block: 26px; }
  .auth-view { gap: 20px; }
  .auth-form { gap: 14px; }
  .auth-foot { padding-bottom: 16px; }
}
