/* ===========================================================================
   auth.css — telas de entrada do sistema (login e cadastro)

   Este arquivo é PROPOSITALMENTE independente do style.css. As telas de
   entrada não precisam de nada do sistema logado, e o style.css tem várias
   camadas de sobrescrita antigas (auth-card, auth-card-modern,
   auth-card-premium) que brigavam entre si a cada ajuste. Aqui é um arquivo
   só, do zero, sem herança.

   Cores: azul = "entrar" (o que você já tem). Laranja da marca = "criar conta".
   O verde saiu porque verde sobre fundo escuro com texto branco tem contraste
   baixo e some no meio do card.
   ========================================================================= */

:root {
  --auth-bg: #070b16;
  --auth-bg-soft: #0e1729;
  --auth-surface: rgba(15, 23, 42, 0.76);
  --auth-surface-2: rgba(30, 41, 59, 0.55);
  --auth-border: rgba(148, 163, 184, 0.20);
  --auth-border-strong: rgba(148, 163, 184, 0.34);
  --auth-text: #eaf0fa;
  --auth-text-dim: #9fb0cb;
  --auth-primary: #3b82f6;
  --auth-primary-deep: #1d4ed8;
  /* Laranja Sinal da marca CeoFrete (texto escuro por cima) */
  --auth-accent: #f59a3a;
  --auth-accent-deep: #f28a1e;
  --auth-accent-ink: #1c1206;
  --auth-danger: #fb7185;
  --auth-danger-bg: rgba(244, 63, 94, 0.14);
  --auth-ok: #34d399;
  --auth-ok-bg: rgba(16, 185, 129, 0.14);
  --auth-radius: 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body.auth-page {
  min-height: 100dvh;
  background:
    radial-gradient(760px 520px at 12% -10%, rgba(59, 130, 246, 0.22), transparent 58%),
    radial-gradient(620px 460px at 92% 4%, rgba(251, 146, 60, 0.12), transparent 56%),
    linear-gradient(180deg, var(--auth-bg-soft) 0%, var(--auth-bg) 62%);
  color: var(--auth-text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  display: flex;
  padding: 24px 16px;
}

/* ---------------------------------------------------------------- estrutura */

/* margin:auto centraliza nos dois eixos e, diferente de align-items:center,
   não corta o topo quando o conteúdo é mais alto que a tela. */
.auth-shell,
.signup-shell { margin: auto; }

.auth-shell {
  width: 100%;
  max-width: 1040px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 48px;
  align-items: center;
}

.auth-brand h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.auth-brand h1.auth-logo { margin: 0 0 18px; line-height: 0; }
.auth-brand h1.auth-logo img { display: block; width: min(340px, 100%); height: auto; }

.auth-brand p {
  margin: 0 0 22px;
  max-width: 30ch;
  color: var(--auth-text-dim);
  font-size: 17px;
}

.auth-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.auth-chips li {
  border: 1px solid var(--auth-border);
  background: var(--auth-surface-2);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-text-dim);
}

/* -------------------------------------------------------------------- card */

.auth-card {
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  padding: 26px 24px 28px;
  box-shadow: 0 30px 70px rgba(2, 6, 23, 0.55);
}

/* --------------------------------------------------------- criar conta
   Fica no TOPO do card, antes dos campos. No celular é a primeira coisa que
   aparece: quem nunca entrou não precisa rolar para achar o cadastro.
   Âmbar porque o azul já é do "Entrar" logo abaixo — duas cores, duas ações. */

.auth-novo-nota {
  margin: 9px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--auth-text-dim);
}

.auth-ou {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--auth-text-dim);
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-ou::before,
.auth-ou::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--auth-border);
}

/* ------------------------------------------------------------------ campos */

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form label {
  display: grid;
  gap: 7px;
}

.auth-form label > span {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--auth-text-dim);
  letter-spacing: 0.01em;
}

.auth-form input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border-radius: 13px;
  border: 1px solid var(--auth-border-strong);
  background: rgba(2, 6, 23, 0.55);
  color: var(--auth-text);
  font-size: 16px; /* 16px evita o zoom automático do iPhone ao focar */
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-form input::placeholder { color: rgba(148, 163, 184, 0.6); }

.auth-form input:focus {
  outline: none;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.auth-eye {
  position: relative;
  display: block;
}

.auth-eye input { padding-right: 84px; }

.auth-eye button {
  position: absolute;
  right: 6px;
  top: 6px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.16);
  color: var(--auth-text-dim);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.auth-eye button:hover { background: rgba(148, 163, 184, 0.26); color: var(--auth-text); }

/* erro por campo */
.field-error .auth-form-input,
.field-error input {
  border-color: var(--auth-danger);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.18);
}

.field-msg {
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-danger);
}

.senha-conferencia { font-size: 13px; font-weight: 600; min-height: 1px; }
.senha-conferencia.confere { color: var(--auth-ok); }
.senha-conferencia.difere { color: var(--auth-danger); }
.senha-conferencia.digitando { color: var(--auth-text-dim); }

/* ------------------------------------------------------------------ botões */

.auth-btn {
  height: 54px;
  width: 100%;
  border: 0;
  border-radius: 14px;
  font-size: 16.5px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  transition: filter .15s ease, transform .1s ease;
}

.auth-btn:active { transform: translateY(1px); }
.auth-btn:hover { filter: brightness(1.07); }

.auth-btn-primary {
  background: linear-gradient(140deg, var(--auth-primary), var(--auth-primary-deep));
  color: #fff;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.3);
}

.auth-btn-accent {
  background: linear-gradient(140deg, var(--auth-accent), var(--auth-accent-deep));
  color: var(--auth-accent-ink);
  box-shadow: 0 14px 30px rgba(249, 115, 22, 0.28);
}

.auth-btn-ghost {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--auth-border-strong);
  color: var(--auth-text);
  box-shadow: none;
}

.auth-btn[disabled] { opacity: .75; cursor: progress; filter: none; }

.auth-btn .spin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  animation: auth-spin .7s linear infinite;
  display: none;
}

.auth-btn.is-busy .spin { display: inline-block; }

@keyframes auth-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ avisos */

.auth-alert {
  border-radius: 13px;
  padding: 12px 14px;
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.auth-alert-error {
  background: var(--auth-danger-bg);
  border-color: rgba(244, 63, 94, 0.35);
  color: #ffd7dd;
}

.auth-alert-ok {
  background: var(--auth-ok-bg);
  border-color: rgba(16, 185, 129, 0.35);
  color: #c9f7e4;
}

/* ================================================================ cadastro */

.signup-shell {
  width: 100%;
  max-width: 520px;
}

.signup-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.signup-back {
  color: var(--auth-text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.signup-back:hover { color: var(--auth-text); }

.signup-badge {
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: var(--auth-accent);
}

.signup-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.signup-steps i {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  display: block;
}

.signup-steps i.is-done { background: linear-gradient(90deg, var(--auth-accent), var(--auth-accent-deep)); }

.signup-title {
  margin: 0 0 4px;
  font-size: clamp(27px, 6vw, 34px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.signup-count {
  margin: 0 0 20px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--auth-text-dim);
}

.signup-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  margin-top: 6px;
}

.signup-actions .auth-btn-ghost { padding: 0 20px; width: auto; }

/* ================================================== forma de pagamento
   Usado na tela de primeiros passos. O comissao.js só depende da estrutura de
   classes, então aqui é a mesma marcação do sistema, repintada com as cores
   das telas de entrada em vez dos tokens do style.css. */

.pag-bloco {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--auth-border-strong);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.4);
}

.pag-titulo {
  color: var(--auth-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.pag-opcoes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.auth-form label.pag-opcao,
label.pag-opcao {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 0;
  padding: 12px 11px;
  border: 1px solid var(--auth-border-strong);
  border-radius: 11px;
  background: rgba(2, 6, 23, 0.5);
  color: var(--auth-text-dim);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}

/* Cinco formas em duas colunas: a última ocupa a linha inteira. */
label.pag-opcao:last-child:nth-child(odd) { grid-column: 1 / -1; }

.pag-opcao input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.pag-opcao span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.45);
  vertical-align: 1px;
}

.auth-form label.pag-opcao:has(input:checked),
label.pag-opcao:has(input:checked) {
  border-color: var(--auth-primary);
  background: rgba(59, 130, 246, 0.2);
  color: var(--auth-text);
}

.pag-opcao:has(input:checked) span::before {
  background: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.pag-opcao:has(input:focus-visible) {
  outline: 2px solid var(--auth-primary);
  outline-offset: 2px;
}

.pag-campos {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 11px;
  border-top: 1px solid var(--auth-border);
}

.pag-bloco .pag-campos[hidden],
.pag-bloco label.pag-campo[hidden],
.auth-form .pag-bloco label.pag-campo[hidden] { display: none; }

.pag-campo-rotulo {
  color: var(--auth-text-dim);
  font-size: 13px;
  font-weight: 700;
}

/* --------------------------------------------------------------- responsivo */

@media (max-width: 900px) {
  body.auth-page { padding: 18px 14px 32px; }

  .auth-shell {
    grid-template-columns: 1fr;
    gap: 22px;
    max-width: 460px;
  }

  /* No celular o painel de apresentação vira só o nome do sistema:
     o que importa na tela pequena é entrar ou criar conta, não ler. */
  .auth-brand { text-align: center; }
  .auth-brand h1 { font-size: 30px; margin-bottom: 6px; }
  .auth-brand h1.auth-logo { display: flex; justify-content: center; margin-bottom: 4px; }
  .auth-brand h1.auth-logo img { width: 220px; }
  .auth-brand p { display: none; }
  .auth-chips { display: none; }

  .auth-card { padding: 20px 18px 24px; }
}

@media (max-width: 420px) {
  .auth-switch a,
  .auth-switch span { font-size: 14px; height: 48px; }
}

/* Símbolo CeoFrete no topo do cadastro */
.signup-logo { display: block; width: 34px; height: 34px; }
