/* /tickets/assets/auth.css — telas de acesso (login, cadastro, senha) */

:root {
  --bg: #0a0f1c;
  --bg-2: #0f1626;
  --surface: #131c2f;
  --surface-2: #18233a;
  --border: #22304d;
  --border-strong: #2f4166;
  --text: #e6ecf5;
  --muted: #94a3b8;
  --dim: #64748b;
  --accent: #22d3a6;
  --accent-2: #38bdf8;
  --warn: #fbbf24;
  --danger: #f87171;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sans: "Inter", system-ui, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  position: relative;
  overflow-x: hidden;
}

/* Fundo: grade + brilho */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: .3;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 25%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 25%, transparent 75%);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  width: 620px; height: 620px;
  top: -180px; right: -160px;
  background: radial-gradient(circle, rgba(34, 211, 166, .16), transparent 60%);
  pointer-events: none;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-2); }

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 800px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8), 0 30px 90px -40px rgba(34, 211, 166, .25);
}

/* ---------- Painel de orientações (esquerda) ---------- */
.info {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 28px 26px 24px;
  display: flex;
  flex-direction: column;
}

.info h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
}

.info .lead {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 18px;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

.steps li strong { color: var(--text); font-weight: 600; }

.steps .n {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(34, 211, 166, .1);
  border: 1px solid rgba(34, 211, 166, .25);
}

.contato {
  margin-top: auto;
  padding-top: 18px;
}

.contato-box {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

.contato-box .t {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}

.contato-box b { color: var(--text); font-weight: 600; }
.contato-box i { color: var(--accent); margin-right: 6px; }

/* ---------- Formulário (direita) ---------- */
.login {
  padding: 28px 28px 22px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.brand img { width: 36px; height: 36px; }

.brand strong {
  display: block;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: .02em;
}

.brand strong span { color: var(--accent); }
.brand small { color: var(--muted); font-size: 11.5px; }

.login h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 6px;
}

.login .sub {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 18px;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid;
}

.alert i { font-size: 17px; line-height: 1.3; }
.alert.erro  { color: #fecaca; background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .35); }
.alert.erro i { color: var(--danger); }
.alert.aviso { color: #fde68a; background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .35); }
.alert.aviso i { color: var(--warn); }
.alert.info  { color: #bae6fd; background: rgba(56, 189, 248, .1); border-color: rgba(56, 189, 248, .35); }
.alert.info i { color: var(--accent-2); }
.alert.ok    { color: #a7f3d0; background: rgba(34, 211, 166, .1); border-color: rgba(34, 211, 166, .35); }
.alert.ok i { color: var(--accent); }

.field { margin-bottom: 13px; }

.field label {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 5px;
  letter-spacing: .03em;
}

.input {
  position: relative;
  display: flex;
  align-items: center;
}

.input > i {
  position: absolute;
  left: 12px;
  color: var(--dim);
  font-size: 15px;
  pointer-events: none;
  transition: color .2s;
}

.input input {
  width: 100%;
  height: 40px;
  padding: 0 42px 0 38px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.input input::placeholder { color: var(--dim); }

.input input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 166, .18);
}

.input:focus-within > i { color: var(--accent); }

/* Preenchimento automático do navegador (e-mail/senha salvos): mantém o fundo escuro do tema.
   O Chrome pinta o campo de claro; a sombra interna cobre essa cor e a transição longa impede que ela apareça.
   Vale também com o campo selecionado, somando o anel de foco (o tema de Halloween tem o seu). */
.input input:-webkit-autofill,
.input input:-webkit-autofill:hover,
.input input:-webkit-autofill:focus,
.input input:autofill {
  -webkit-box-shadow: 0 0 0 100px var(--bg) inset !important;
  box-shadow: 0 0 0 100px var(--bg) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
  transition: background-color 600000s 0s, color 600000s 0s;
}
.input input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 100px var(--bg) inset, 0 0 0 3px rgba(34, 211, 166, .18) !important;
  box-shadow: 0 0 0 100px var(--bg) inset, 0 0 0 3px rgba(34, 211, 166, .18) !important;
}
html.tema-halloween .input input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 100px var(--bg) inset, 0 0 0 3px rgba(255, 122, 26, .22) !important;
  box-shadow: 0 0 0 100px var(--bg) inset, 0 0 0 3px rgba(255, 122, 26, .22) !important;
}

.toggle-pass {
  position: absolute;
  right: 4px;
  width: 32px; height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  font-size: 17px;
  cursor: pointer;
  transition: color .2s, background .2s;
}

.toggle-pass:hover { color: var(--text); background: var(--surface-2); }

.caps {
  display: none;
  margin-top: 7px;
  font-size: 12.5px;
  color: var(--warn);
  font-family: var(--mono);
}

.caps.show { display: block; }

.btn-entrar {
  width: 100%;
  height: 42px;
  margin-top: 4px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background .2s, transform .15s, box-shadow .2s;
}

.btn-entrar:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -10px rgba(56, 189, 248, .6);
}

.btn-entrar:disabled { opacity: .75; cursor: progress; transform: none; }

.spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(10, 15, 28, .3);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.btn-entrar.loading .spinner { display: inline-block; }
.btn-entrar.loading .bi { display: none; }

.links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
}

.links a { display: inline-flex; align-items: center; gap: 6px; }

.login-foot {
  margin-top: auto;
  padding-top: 16px;
  font-size: 11.5px;
  color: var(--dim);
  text-align: center;
}

/* ---------- Responsivo ---------- */
@media (max-width: 880px) {
  .wrap { grid-template-columns: 1fr; max-width: 400px; }
  .login { order: -1; padding: 24px 22px 20px; }
  .info { border-right: 0; border-top: 1px solid var(--border); padding: 22px 22px 20px; }
}

@media (max-width: 420px) {
  body { padding: 16px 12px; }
  .links { flex-direction: column; }
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Variante de coluna única (cadastro, recuperar/redefinir senha) ---------- */
.wrap.single { grid-template-columns: 1fr; max-width: 440px; }
.wrap.single.largo { max-width: 560px; }

.input select {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 38px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.input select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 166, .18); }
.input select:disabled { opacity: .6; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.hint { margin-top: 6px; font-size: 12px; color: var(--dim); font-family: var(--mono); }
.hint.erro { color: var(--danger); }
.input input.ok { border-color: var(--accent); }
.input input.bad { border-color: var(--danger); }

@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
.text-dim { color: var(--dim); }

/* ---------- Celular: ajustes finos ---------- */
@media (max-width: 880px) {
  /* Cartão começa no topo (sem centralizar na altura) e rola normalmente */
  body { align-items: flex-start; min-height: 100dvh; padding: 20px 14px 28px; }
  .wrap { margin: 0 auto; }

  /* 16px evita o zoom automático do iPhone; campos e botões mais altos para o dedo */
  .input input, .input select { height: 48px; font-size: 16px; }
  .toggle-pass { width: 44px; height: 44px; }
  .btn-entrar { height: 50px; font-size: 16px; }
  .field label { font-size: 12.5px; }

  .login h1 { font-size: 22px; }
  .login .sub { font-size: 14px; }
  .links { gap: 8px; }
  .links a { flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }

  /* Orientações abaixo do login: mais compactas */
  .info h2 { font-size: 15px; }
  .steps { gap: 10px; }
}

@media (max-width: 420px) {
  body { padding: 14px 10px 24px; }
  .wrap { border-radius: 12px; }
  .login { padding: 22px 16px 18px; }
  .info { padding: 20px 16px 18px; }
  .brand img { width: 32px; height: 32px; }
  .links { flex-direction: column; }
}
