/* ============================================================
   StaFlow — estilos compartilhados das páginas de auth
   Design System Enterprise v2.0 (dark, Inter, azul)
   ============================================================ */

:root {
  /* paleta enterprise */
  --bg:           #111827;
  --surface:      #1F2937;
  --surface-2:    #374151;
  --surface-hover:#243040;
  --text:         #F9FAFB;
  --text-muted:   #9CA3AF;
  --text-faint:   #6B7280;
  --blue:         #3B82F6;
  --blue-dark:    #1D4ED8;
  --blue-dim:     rgba(59,130,246,0.12);
  --blue-border:  rgba(59,130,246,0.35);
  --green:        #10B981;
  --amber:        #F59E0B;
  --red:          #EF4444;
  --purple:       #8B5CF6;
  --border:       #374151;
  --border-subtle: rgba(55,65,81,0.5);
  --border-strong: rgba(249,250,251,0.16);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius:      6px;
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   8px;
  --radius-xl:   12px;
  --radius-btn:  6px;
  --radius-card: 8px;
  --shadow-md:   0 4px 12px rgba(0,0,0,0.4);
  --shadow-blue: 0 4px 20px rgba(59,130,246,0.25);
  --transition:  0.15s ease;
  --white-faint: var(--text-faint);

  /* aliases legados (mantidos para compatibilidade com <style> inline de cadastro.html) */
  --navy-brand:  var(--blue);
  --navy-deep:   var(--bg);
  --navy:        var(--surface);
  --navy-mid:    var(--surface-2);
  --navy-light:  var(--surface-2);
  --teal:        var(--blue);
  --teal-hover:  var(--blue-dark);
  --teal-dim:    var(--blue-dim);
  --teal-border: var(--blue-border);
  --white:       var(--text);
  --white-dim:   var(--text-muted);
  --white-muted: var(--text-faint);
  --font-display: var(--font);
  --font-body:    var(--font);
  --font-mono:    var(--font);
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* glow radial sutil no canto superior direito */
body::before {
  content: '';
  position: fixed;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

/* ---------- Layout ---------- */
.auth-shell {
  position: relative; z-index: 1;
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 36px 40px 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.auth-card.wide { max-width: 520px; }

/* ---------- Brand ---------- */
.brand {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.brand .mark {
  width: 40px; height: 40px;
}
.brand .wordmark {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.5px;
}
.brand .wordmark .sta  { color: var(--text); }
.brand .wordmark .flow { color: var(--blue); }
.brand .tagline {
  font-size: 12px;
  letter-spacing: 0.3px;
  color: var(--text-faint);
}

/* ---------- Tipografia ---------- */
.auth-title {
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.4px;
  color: var(--text);
  margin-bottom: 6px;
  text-align: center;
}
.auth-sub {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ---------- Formulário ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--text-faint);
}

.input {
  font-family: var(--font);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.input::placeholder { color: var(--text-faint); }
.input:focus {
  outline: none;
  border-color: var(--blue-border);
  box-shadow: 0 0 0 3px var(--blue-dim);
}
.input.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}

.input-wrap { position: relative; }
.input-wrap .toggle-pass {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-faint); font-size: 10px;
  font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase;
  padding: 4px 6px;
  transition: color 0.15s;
}
.input-wrap .toggle-pass:hover { color: var(--blue); }
.input-wrap .input { padding-right: 64px; }

.field-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
}
.field-error {
  font-size: 11px;
  color: var(--red);
  margin-top: 4px;
  display: none;
}
.field.has-error .field-error { display: block; }
.field.has-error .input { border-color: var(--red); }

/* ---------- Field row (cadastro etapa 2) ---------- */
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

/* ---------- Botão primário ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--blue);
  color: var(--text);
  font-family: var(--font);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  letter-spacing: 0.2px;
  margin-top: 8px;
  box-shadow: 0 4px 14px rgba(59,130,246,0.25);
}
.btn:hover:not(:disabled) {
  background: var(--blue-dark);
  transform: translateY(-1px);
}
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(55,65,81,0.4);
  border-color: var(--text-faint);
}

/* spinner */
.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn-ghost .spinner {
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--text);
}
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-label { opacity: 0.5; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Links auxiliares ---------- */
.aux-links {
  display: flex; justify-content: space-between;
  margin-top: 18px;
  font-size: 13px;
}
.aux-links a {
  color: var(--text-muted);
  transition: color var(--transition);
}
.aux-links a:hover { color: var(--blue); }
.aux-center {
  margin-top: 22px; font-size: 13px; color: var(--text-muted); text-align: center;
}
.aux-center a { color: var(--blue); font-weight: 500; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 200;
  max-width: 92%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.toast.show {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.toast.error   { border-color: var(--red);  color: var(--red); }
.toast.success { border-color: var(--blue); color: var(--blue); }
.toast .ico {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ---------- Stepper ---------- */
.stepper { display: flex; gap: 8px; margin-bottom: 22px; }
.stepper .step {
  flex: 1; height: 4px; border-radius: 2px;
  background: var(--surface-2);
  transition: background var(--transition);
}
.stepper .step.active { background: var(--blue); }
.stepper .step.done   { background: var(--blue-dark); }
.step-label {
  text-align: center;
  font-size: 10px; letter-spacing: 2px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 22px;
}

/* ---------- Barra de força ---------- */
.strength {
  display: flex; gap: 4px; margin-top: 8px;
}
.strength i {
  flex: 1; height: 3px; border-radius: 2px;
  background: var(--surface-2); transition: background var(--transition);
}
.strength.s1 i:nth-child(-n+1) { background: var(--red); }
.strength.s2 i:nth-child(-n+2) { background: var(--amber); }
.strength.s3 i:nth-child(-n+3) { background: var(--blue); }
.strength.s4 i:nth-child(-n+4) { background: var(--green); }
.strength-text {
  font-size: 10px; letter-spacing: 1.5px;
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 4px;
  color: var(--text-faint);
}

/* ---------- Checkbox de termos ---------- */
.checkbox-label {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--text-muted); cursor: pointer;
  margin-top: 4px; margin-bottom: 16px; line-height: 1.5;
}
.checkbox-label input[type="checkbox"] {
  width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px;
  accent-color: var(--blue); cursor: pointer;
}
.checkbox-label a { color: var(--blue); font-weight: 500; }
.checkbox-label.has-error { color: var(--red); }
.checkbox-label.has-error a { color: var(--red); }

/* ---------- Radio cards ---------- */
.radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg);
}
.radio-card:hover { border-color: var(--text-faint); }
.radio-card input { display: none; }
.radio-card .rc-title {
  font-weight: 600; font-size: 14px; color: var(--text);
}
.radio-card .rc-desc {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
}
.radio-card.selected {
  border-color: var(--blue);
  background: var(--blue-dim);
}

/* ---------- Sucesso (após signup / reset) ---------- */
.success-box {
  text-align: center;
}
.success-box .check {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--blue-dim);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  color: var(--blue);
  font-size: 28px;
}
.countdown {
  font-size: 12px; letter-spacing: 0.5px;
  color: var(--text-muted); margin-top: 12px;
}

/* ---------- Footer ---------- */
.auth-footer {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--text-faint);
  padding: 24px 12px;
  position: relative; z-index: 1;
}

/* ---------- Responsivo ---------- */
@media (max-width: 480px) {
  .auth-card { padding: 28px 24px; }
  .auth-title { font-size: 20px; }
  .radio-row { grid-template-columns: 1fr; }
}
