* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --border: rgba(255, 255, 255, 0.1);
  --text: #f5f5f7;
  --text-muted: rgba(245, 245, 247, 0.6);
  --accent: #039dfc;
  --accent-2: #5cc4ff;
  --danger: #ff6b6b;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #000;
  color: var(--text);
}

.bg-grid {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
}

.highlight {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Layout ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

/* imagem em cartão arredondado (esquerda) */
.auth-visual {
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0a1a33;
}
.auth-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  display: block;
}

/* lado do formulário (direita) */
.auth-side {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 16px 32px;
}

.back-link {
  position: absolute;
  top: 16px; right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 10px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color .2s, border-color .2s, background .2s;
}
.back-link:hover { color: var(--text); border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.04); }
.back-link svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Cartão do formulário ---------- */
.card {
  width: 100%;
  max-width: 440px;
  padding: 36px 32px 32px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(14, 16, 20, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.card h1 {
  font-size: 1.85rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.card-sub {
  margin: 10px 0 28px;
  font-size: .92rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ---------- Campos com rótulo que sobe ---------- */
.field { margin-bottom: 14px; }

.control {
  position: relative;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.control:hover { border-color: rgba(255, 255, 255, 0.18); }
.control:focus-within {
  border-color: var(--accent);
  background: rgba(3, 157, 252, 0.04);
  box-shadow: 0 0 0 3px rgba(3, 157, 252, 0.15);
}
.control.invalid { border-color: var(--danger); }
.control.invalid:focus-within { box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15); }

.control .icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .2s;
  pointer-events: none;
}
.control:focus-within .icon { stroke: var(--accent-2); }

.control input {
  width: 100%;
  height: 56px;
  padding: 20px 14px 6px 44px;
  font: 400 .95rem 'Inter', sans-serif;
  color: var(--text);
  background: none;
  border: none;
  outline: none;
}
.control label {
  position: absolute;
  left: 44px; top: 50%;
  transform: translateY(-50%);
  font-size: .92rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: top .18s ease, font-size .18s ease, color .18s ease;
}
.control input:focus + label,
.control input:not(:placeholder-shown) + label {
  top: 16px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.control input:focus + label { color: var(--accent-2); }

.control:has(.toggle-pass) input { padding-right: 48px; }
.toggle-pass {
  position: absolute;
  top: 50%; right: 10px;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}
.toggle-pass:hover { background: rgba(255, 255, 255, 0.06); }
.toggle-pass svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.toggle-pass .i-eye-off { display: none; }
.toggle-pass.on .i-eye { display: none; }
.toggle-pass.on .i-eye-off { display: block; }

.field-error {
  display: block;
  margin-top: 6px;
  padding-left: 4px;
  font-size: .8rem;
  color: var(--danger);
}
.field-error:empty { display: none; }

/* ---------- Força da senha ---------- */
.strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 0 4px;
}
.strength-bars { display: flex; gap: 4px; }
.strength-bars i {
  width: 28px; height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  transition: background .25s;
}
.strength-label { font-size: .75rem; color: var(--text-muted); }

.strength[data-level="1"] i:nth-child(-n+1) { background: #ff6b6b; }
.strength[data-level="2"] i:nth-child(-n+2) { background: #f5a524; }
.strength[data-level="3"] i:nth-child(-n+3) { background: var(--accent-2); }
.strength[data-level="4"] i { background: #22c55e; }
.strength[data-level="1"] .strength-label { color: #ff8a8a; }
.strength[data-level="2"] .strength-label { color: #f5b84f; }
.strength[data-level="3"] .strength-label { color: var(--accent-2); }
.strength[data-level="4"] .strength-label { color: #4ade80; }

/* ---------- Aceite dos termos ---------- */
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  cursor: pointer;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
  flex-shrink: 0;
  width: 20px; height: 20px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: background .2s, border-color .2s;
}
.check-box svg {
  width: 13px; height: 13px;
  fill: none; stroke: #fff; stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .15s, transform .15s;
}
.check input:checked + .check-box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .check-box svg { opacity: 1; transform: none; }
.check input:focus-visible + .check-box { box-shadow: 0 0 0 3px rgba(3, 157, 252, 0.3); }
.check-text { font-size: .84rem; line-height: 1.5; color: var(--text-muted); }
.check-text a, .auth-switch a {
  color: var(--accent-2);
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
}
.check-text a:hover, .auth-switch a:hover { text-decoration: underline; }
.check-text a:focus-visible, .auth-switch a:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* ---------- Aviso "em breve" ---------- */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -8px 0 22px;
  padding: 12px 14px;
  font-size: .84rem;
  line-height: 1.5;
  color: #f5d08a;
  border-radius: 12px;
  background: rgba(245, 165, 36, 0.08);
  border: 1px solid rgba(245, 165, 36, 0.28);
}
.notice strong { color: #ffe1a6; font-weight: 600; }
.notice svg {
  flex-shrink: 0;
  width: 18px; height: 18px;
  margin-top: 1px;
  fill: none; stroke: #f5b84f; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.success-icon.soon {
  background: rgba(245, 165, 36, 0.1);
  border-color: rgba(245, 165, 36, 0.35);
}
.success-icon.soon svg { stroke: #f5b84f; }
.auth-success strong { color: var(--text); }
.auth-success p { margin-bottom: 4px; }

/* ---------- Login: lembrar de mim + esqueci a senha ---------- */
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.check.check-inline { margin-top: 0; align-items: center; }
.check-inline .check-box { margin-top: 0; }
.link-forgot {
  font-size: .84rem;
  font-weight: 600;
  color: var(--accent-2);
  text-decoration: none;
}
.link-forgot:hover { text-decoration: underline; }

/* ---------- Verificação anti-robô ---------- */
.captcha {
  margin-top: 20px;
  min-height: 65px; /* reserva o espaço do widget enquanto ele carrega */
}

/* ---------- Botão ---------- */
.btn-submit {
  margin-top: 24px;
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: 600 .98rem 'Inter', sans-serif;
  color: #fff;
  text-decoration: none;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transition: filter .2s, transform .15s;
}
.btn-submit:hover { filter: brightness(1.08); }
.btn-submit:active { transform: scale(.98); }
.btn-submit svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform .2s;
}
.btn-submit:hover svg { transform: translateX(3px); }

.auth-switch {
  margin-top: 20px;
  font-size: .9rem;
  color: var(--text-muted);
}

/* ---------- Sucesso ---------- */
.auth-success { text-align: center; padding: 12px 0 4px; }
.success-icon {
  width: 60px; height: 60px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.success-icon svg {
  width: 28px; height: 28px;
  fill: none; stroke: #4ade80; stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.auth-success h2 { font-size: 1.6rem; margin-bottom: 10px; }
.auth-success p { color: var(--text-muted); line-height: 1.6; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; padding: 12px; gap: 0; }
  .auth-visual {
    position: relative;
    top: 0;
    height: 230px;
    border-radius: 18px;
  }
  .auth-visual img { object-position: left top; }
  .auth-side { padding: 72px 4px 32px; }
  .back-link { top: 20px; right: 4px; }
  .card { padding: 28px 20px 24px; }
}

/* ---------- Envio ao servidor ---------- */
.btn-submit:disabled { cursor: default; }
.btn-submit.carregando { opacity: .7; pointer-events: none; }
.erro-geral { margin-top: 12px; text-align: center; }
