/* ═══════════════════════════════════════════════════════════════
   IDENTIDADE DAS TELAS DE AUTH — CRM + Portal do Cliente
   ───────────────────────────────────────────────────────────────
   Split: cena isométrica à esquerda, formulário à direita.
   Usada por login, cadastro, reset-senha e pelas 4 telas do portal.
   A cena é injetada por /js/auth-art.js (não repetir SVG por página).

   NÃO confundir com portal-auth.css — aquele é da SPA portal-cliente
   e continua intocado.

   Paleta clara com o acento --brand do CRM (#6C63FF). Trocar para
   dark = mexer só no bloco :root abaixo.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --brand:       #6C63FF;
  --brand-hover: #7C74FF;
  --brand-deep:  #574FD6;
  --brand-soft:  #8B7FFF;
  --brand-ring:  rgba(108,99,255,.16);

  --srf:    #FFFFFF;   /* painel do formulário */
  --art-bg: #F3F5FB;   /* painel da ilustração */
  --field:  #F4F6FB;
  --line:   #E6EAF4;

  --ink:   #171B2E;
  --ink2:  #4E5670;
  /* 4.6:1 sobre branco — tons mais claros reprovam no AA para 13px */
  --muted: #676E89;

  --danger:     #C7304B;
  --danger-bg:  #FDEEF1;
  --danger-bd:  #F5CBD4;
  --success:    #12764E;
  --success-bg: #E9F7F0;
  --success-bd: #BFE6D4;

  --font-display: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --r-sm: 8px;
  --r-md: 10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--srf);
  -webkit-font-smoothing: antialiased;
}

/* ── SPLIT ─────────────────────────────────────────────────────── */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr);
}

/* ── PAINEL DA ARTE ────────────────────────────────────────────── */
.auth-art {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 18% 8%,  #FFFFFF 0%, transparent 55%),
    radial-gradient(90% 80% at 88% 92%, rgba(108,99,255,.10) 0%, transparent 60%),
    var(--art-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 40px;
}
/* feixes de luz diagonais — o brilho de estúdio da referência */
.auth-art::before,
.auth-art::after {
  content: '';
  position: absolute;
  top: -30%;
  width: 44%;
  height: 170%;
  background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,0));
  transform: rotate(24deg);
  pointer-events: none;
}
.auth-art::before { left: -6%; }
.auth-art::after  { left: 46%; width: 20%; opacity: .55; }

.art-scene {
  position: relative;
  width: 100%;
  max-width: 640px;
  height: auto;
  /* em viewport baixa a cena encolhe (preserveAspectRatio) em vez de estourar */
  max-height: 60vh;
  overflow: visible;
}

/* faces isométricas */
.art-scene polygon { stroke: rgba(126,138,175,.22); stroke-width: .8; stroke-linejoin: round; }
.iso-t { fill: #FFFFFF; }
.iso-r { fill: #E8ECF6; }
.iso-l { fill: #D7DDEF; }
.iso-t-accent { fill: var(--brand-soft); }
.iso-r-accent { fill: var(--brand); }
.iso-l-accent { fill: var(--brand-deep); }
.iso-face     { fill: #FCFDFF; }
.iso-face-bar { fill: rgba(108,99,255,.30); stroke: none; }
.iso-trace {
  fill: none; stroke: #C5CDE4; stroke-width: 1.3;
  stroke-linecap: round; stroke-linejoin: round;
}
.iso-shadow { fill: rgba(88,100,140,.10); }
.iso-shield      { fill: var(--brand); }
.iso-shield-tick { fill: none; stroke: #FFFFFF; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.iso-wordmark {
  font-family: var(--font-display);
  font-size: 9px; font-weight: 600; letter-spacing: .18em;
  fill: rgba(108,99,255,.55);
}

.art-float { animation: floatY 7s ease-in-out infinite; }
.art-float-slow { animation: floatY 9s ease-in-out infinite reverse; }
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

.art-legend { position: relative; max-width: 460px; text-align: center; }
.art-legend strong {
  display: block;
  font-family: var(--font-display);
  font-size: 19px; font-weight: 500; color: var(--muted);
  letter-spacing: -.015em; line-height: 1.4;
}

/* ── PAINEL DO FORMULÁRIO ──────────────────────────────────────── */
.auth-panel {
  background: var(--srf);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 56px;
}
.auth-inner { width: 100%; max-width: 372px; margin: 0 auto; }

/* marca do cliente (multi-tenant) */
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 42px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(140deg, var(--brand-soft), var(--brand));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-nome { font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.brand-sub  { font-size: 10px; letter-spacing: .16em; color: var(--muted); font-weight: 600; margin-top: 1px; }

h1.title {
  font-family: var(--font-display);
  font-size: 34px; font-weight: 500; letter-spacing: -.025em;
  line-height: 1.12; margin-bottom: 10px;
}
.subtitle {
  font-size: 13.5px; color: var(--muted); line-height: 1.65;
  margin-bottom: 32px;
}

/* ── CAMPOS ────────────────────────────────────────────────────── */
.field { margin-bottom: 18px; position: relative; }
.field label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--ink2); margin-bottom: 7px;
}
.field input {
  width: 100%; padding: 13px 14px;
  background: var(--field);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-family: var(--font-sans); font-size: 14px; color: var(--ink);
  transition: background .15s, border-color .15s, box-shadow .15s;
  outline: none; -webkit-appearance: none;
}
.field input::placeholder { color: #99A0B8; }
.field input:focus {
  background: var(--srf);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-ring);
}
.field input.error { border-color: var(--danger); }
.field input[readonly] { color: var(--muted); }

.field-action {
  position: absolute; right: 8px; top: 30px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 6px; font-size: 14px; line-height: 1;
  border-radius: 6px; transition: color .15s, background .15s;
}
.field-action:hover { color: var(--ink2); background: rgba(0,0,0,.04); }

.field-hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }

.field-row { display: flex; justify-content: flex-end; margin: -4px 0 22px; }
.link-forgot { font-size: 12.5px; color: var(--ink2); text-decoration: none; transition: color .15s; }
.link-forgot:hover { color: var(--brand); }

/* ── REQUISITOS DE SENHA ───────────────────────────────────────── */
/* lista com bolinha (reset-senha, portal-ativar, portal-reset) */
.reqs {
  margin-top: 10px; padding: 12px 14px;
  background: var(--field); border-radius: var(--r-sm);
}
.req {
  display: flex; align-items: center; gap: 9px;
  font-size: 12px; color: var(--muted); margin-bottom: 5px;
}
.req:last-child { margin-bottom: 0; }
.req .dot {
  width: 7px; height: 7px; border-radius: 50%;
  border: 1.5px solid #B9C0D6; flex-shrink: 0;
  transition: background .18s, border-color .18s;
}
.req.ok { color: var(--success); }
.req.ok .dot { background: var(--success); border-color: var(--success); }

/* grade compacta (cadastro) */
.reqs-grid {
  margin-top: 10px; display: grid;
  grid-template-columns: 1fr 1fr; gap: 5px 14px;
}
.sr-item { font-size: 11.5px; color: var(--muted); transition: color .15s; }
.sr-item.ok { color: var(--success); font-weight: 500; }

/* ── CAIXA DE BOAS-VINDAS (portal-ativar) ──────────────────────── */
.welcome {
  background: rgba(108,99,255,.07);
  border: 1px solid rgba(108,99,255,.20);
  border-radius: var(--r-sm);
  padding: 13px 15px; margin-bottom: 20px;
  font-size: 13px; color: var(--ink2); line-height: 1.5;
}
.welcome b { color: var(--brand); font-weight: 600; }

/* ── BOTÕES (mesmo padrão do CRM) ──────────────────────────────── */
.btn-submit {
  width: 100%; padding: 14px;
  background: var(--brand); color: #fff;
  border: none; border-radius: var(--r-sm);
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s, box-shadow .15s, transform .15s;
  box-shadow: 0 6px 18px rgba(108,99,255,.26);
}
.btn-submit:hover:not(:disabled) {
  background: var(--brand-hover); transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(108,99,255,.30);
}
.btn-submit:active:not(:disabled) { transform: translateY(0); }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-submit .btn-loading { display: none; }
.btn-submit.loading .btn-text { display: none; }
.btn-submit.loading .btn-loading { display: inline; }

.btn-ghost {
  display: inline-block;
  font-size: 13px; font-weight: 500;
  color: var(--brand); text-decoration: none;
  transition: color .15s;
}
.btn-ghost:hover { color: var(--brand-hover); text-decoration: underline; }

/* ── RODAPÉS ───────────────────────────────────────────────────── */
.foot-secure {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 24px; font-size: 11.5px; color: var(--muted);
}
.foot-help {
  margin-top: 40px; padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted); text-align: center;
}
.foot-help a { color: var(--brand); text-decoration: none; font-weight: 500; }
.foot-help a:hover { text-decoration: underline; }
.sec-back { margin-top: 22px; text-align: center; }
.sec-back a { font-size: 12.5px; color: var(--ink2); text-decoration: none; transition: color .15s; }
.sec-back a:hover { color: var(--brand); }

/* ── ALERTAS ───────────────────────────────────────────────────── */
/* padrão único: .alert fica oculto, .show revela, .error/.success pintam */
.alert {
  display: none;
  padding: 11px 13px; border-radius: var(--r-sm);
  font-size: 13px; margin-bottom: 18px; line-height: 1.5;
}
.alert.show    { display: block; }
.alert.error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger-bd); }
.alert.success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-bd); }

/* ── ESTADOS ───────────────────────────────────────────────────── */
.loading { text-align: center; color: var(--muted); padding: 48px 0; font-size: 13px; }

.form-section { display: none; }
.form-section.active { display: block; }

.success-box { text-align: center; padding: 8px 0; }
.success-icon { font-size: 48px; margin-bottom: 16px; }
.success-box h2 {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 600; letter-spacing: -.02em;
  margin-bottom: 10px;
}
.success-box p { font-size: 13.5px; color: var(--muted); line-height: 1.65; margin-bottom: 24px; }

/* ── MODAL DE INATIVIDADE (login) ──────────────────────────────── */
.inactivity-overlay {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(23,27,46,.45); backdrop-filter: blur(5px);
  align-items: center; justify-content: center;
}
.inactivity-overlay.show { display: flex; }
.inactivity-box {
  background: var(--srf); border: 1px solid var(--line);
  border-radius: 16px; padding: 38px 40px; max-width: 360px; width: 90%;
  text-align: center; box-shadow: 0 24px 60px rgba(23,27,46,.20);
}
.inactivity-box h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin-bottom: 12px; }
.inactivity-box p { font-size: 13px; color: var(--muted); margin-bottom: 22px; line-height: 1.6; }
.inactivity-count { font-family: var(--font-display); font-size: 52px; font-weight: 600; color: var(--brand); line-height: 1; margin-bottom: 20px; }

/* ── RESPONSIVO ────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { border-left: none; padding: 40px 24px; }
}
@media (max-width: 420px) {
  .auth-panel { padding: 32px 20px; }
  h1.title { font-size: 29px; }
  .brand { margin-bottom: 32px; }
  .reqs-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .art-float, .art-float-slow { animation: none; }
  .btn-submit:hover { transform: none; }
}
