/* ══════════════════════════════════════════════════════════════
   REGISTER CSS — WSSH
   Tokens e estilos para a tela de cadastro público.
   Compartilha a linguagem visual do login admin.
══════════════════════════════════════════════════════════════ */

/* ── Tokens dark ── */
[data-theme="dark"] {
  --bg:         #0A0A0A;
  --bg-mid:     #111111;
  --bg-card:    #181818;
  --bg-surface: #1E1E1E;
  --bg-raised:  #252525;
  --bg-deep:    #0A0A0A;
  --accent:        #F2F2F2;
  --accent-glow:   rgba(242,242,242,.08);
  --accent-dim:    rgba(242,242,242,.06);
  --accent-border: rgba(242,242,242,.16);
  --amber:  #FB923C; --amber-dim:  rgba(251,146,60,.12);
  --green:  #4ADE80; --green-dim:  rgba(74,222,128,.08);
  --red:    #F05252; --red-dim:    rgba(240,82,82,.12);
  --blue:   #60A5FA; --blue-dim:   rgba(96,165,250,.08);
  --purple: #A78BFA; --purple-dim: rgba(167,139,250,.08);
  --orange: #FB923C;
  --yellow: #FCD34D;
  --text-1: #F2F2F2;
  --text-2: #7A7A7A;
  --text-3: #4A4A4A;
  --border:   rgba(255,255,255,.10);
  --border-2: rgba(255,255,255,.07);
  --border-3: rgba(255,255,255,.04);
  --shadow-card:   0 4px 20px rgba(0,0,0,.60);
  --shadow-modal:  0 24px 80px rgba(0,0,0,.80);
  --shadow-accent: 0 0 20px rgba(242,242,242,.06);
  --gradient-a: #F2F2F2;
  --gradient-b: #FB923C;
  --gradient-c: #4ADE80;
  --font-display: 'Syne', sans-serif;
  --font-body:    'Source Sans 3', sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;
  --orb1-color: rgba(242,242,242,.07);
  --orb2-color: rgba(251,146,60,.08);
  --orb3-color: rgba(74,222,128,.06);
  --grid-line:  rgba(255,255,255,.028);
  --card-bg:    rgba(24,24,24,.96);
  --input-bg:   rgba(255,255,255,.04);
}

/* ── Tokens light ── */
[data-theme="light"] {
  --bg:         #F5F6FA;
  --bg-mid:     #FFFFFF;
  --bg-card:    #FFFFFF;
  --bg-surface: #F0F1F6;
  --bg-raised:  #E8EAF0;
  --bg-deep:    #ECEDF5;
  --accent:        #2563EB;
  --accent-glow:   rgba(37,99,235,.15);
  --accent-dim:    rgba(37,99,235,.08);
  --accent-border: rgba(37,99,235,.22);
  --amber:  #F59E0B; --amber-dim:  rgba(245,158,11,.12);
  --green:  #10B981; --green-dim:  rgba(16,185,129,.10);
  --red:    #EF4444; --red-dim:    rgba(239,68,68,.10);
  --blue:   #3B82F6; --blue-dim:   rgba(59,130,246,.10);
  --purple: #8B5CF6; --purple-dim: rgba(139,92,246,.10);
  --orange: #F97316;
  --yellow: #EAB308;
  --text-1: #1E293B;
  --text-2: #64748B;
  --text-3: #94A3B8;
  --border:   rgba(37,99,235,.14);
  --border-2: rgba(0,0,0,.08);
  --border-3: rgba(0,0,0,.04);
  --shadow-card:   0 1px 8px rgba(0,0,0,.06);
  --shadow-modal:  0 16px 56px rgba(0,0,0,.16);
  --shadow-accent: 0 0 20px rgba(37,99,235,.14);
  --gradient-a: #2563EB;
  --gradient-b: #3B82F6;
  --gradient-c: #10B981;
  --font-display: 'Outfit', sans-serif;
  --font-body:    'Nunito Sans', sans-serif;
  --font-mono:    'Roboto Mono', monospace;
  --orb1-color: rgba(37,99,235,.12);
  --orb2-color: rgba(16,185,129,.10);
  --orb3-color: rgba(245,158,11,.08);
  --grid-line:  rgba(37,99,235,.06);
  --card-bg:    rgba(255,255,255,.96);
  --input-bg:   rgba(0,0,0,.02);
}


/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}

/* ── Background com orbs ── */
.reg-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(90px);
  animation: drift 14s ease-in-out infinite alternate;
}
.orb1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--orb1-color) 0%, transparent 70%);
  top: -160px; left: -100px; animation-duration: 16s;
}
.orb2 {
  width: 340px; height: 340px;
  background: radial-gradient(circle, var(--orb2-color) 0%, transparent 70%);
  bottom: -100px; right: -80px; animation-duration: 19s; animation-delay: -6s;
}
.orb3 {
  width: 260px; height: 260px;
  background: radial-gradient(circle, var(--orb3-color) 0%, transparent 70%);
  top: 45%; left: 52%; animation-duration: 22s; animation-delay: -11s;
}
@keyframes drift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(28px,18px) scale(1.07); }
}
.reg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
}

/* ── Theme toggle ── */
.theme-toggle {
  position: fixed; top: 18px; right: 18px; z-index: 200;
  width: 38px; height: 38px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s, transform .15s;
}
.theme-toggle:hover { background: var(--bg-raised); transform: scale(1.06); }
.theme-toggle svg {
  width: 16px; height: 16px;
  stroke: var(--text-2); stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  transition: stroke .2s;
}
.theme-toggle:hover svg { stroke: var(--text-1); }
.icon-moon { display: block; }
.icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: block; }

/* ── Card central ── */
#register-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
}
.reg-card {
  position: relative; z-index: 1;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 36px 32px 28px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-modal);
  backdrop-filter: blur(24px);
  animation: cardIn .45s cubic-bezier(.22,1,.36,1) both;
  transition: background .3s, border-color .3s;
}
@keyframes cardIn {
  from { opacity:0; transform: translateY(22px) scale(.96); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}

/* ── Logo ── */
.reg-logo {
  display: flex; align-items: center; gap: 13px;
  margin-bottom: 24px;
}
.reg-logo-icon {
  width: 44px; height: 44px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-card);
}
.reg-logo-icon svg {
  width: 20px; height: 20px;
  stroke: var(--accent); stroke-width: 1.8; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
.reg-logo-name {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700;
  color: var(--text-1); letter-spacing: .2px;
}
.reg-logo-sub {
  font-size: 11px; color: var(--text-3);
  font-family: var(--font-mono);
  letter-spacing: .6px; margin-top: 1px;
}

/* ── Step indicator ── */
.step-indicator { display: flex; gap: 6px; margin-bottom: 24px; }
.step-dot {
  height: 3px; border-radius: 2px;
  background: var(--border);
  transition: background .3s, width .3s, flex .3s;
  flex: 1;
}
.step-dot.active { background: var(--accent); flex: 2; }
.step-dot.done   { background: var(--accent); opacity: .4; }

/* ── Steps ── */
.reg-step { display: none; }
.reg-step.active { display: block; animation: stepIn .3s ease both; }
@keyframes stepIn {
  from { opacity:0; transform: translateX(10px); }
  to   { opacity:1; transform: translateX(0); }
}

.reg-title {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700;
  color: var(--text-1); margin-bottom: 4px;
}
.reg-sub {
  font-size: 13.5px; color: var(--text-2);
  line-height: 1.5; margin-bottom: 22px;
}

/* ── Fields ── */
.rfield { margin-bottom: 14px; }
.rlabel {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 600;
  color: var(--text-3); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 7px;
  font-family: var(--font-mono);
}
.field-hint {
  font-size: 10px; color: var(--text-3);
  font-weight: 400; text-transform: none; letter-spacing: 0;
}
.field-counter {
  font-size: 10px; color: var(--text-3);
  font-family: var(--font-mono);
  text-align: right; margin-top: 4px;
}
.rinput-wrap { position: relative; }
.rinput {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text-1);
  font-size: 14px; font-family: var(--font-body);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .3s;
}
.rinput::placeholder { color: var(--text-3); }
.rinput:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.rinput.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-dim);
}
.rinput-icon {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--text-3); transition: color .2s;
}
.rinput-icon:hover { color: var(--text-1); }
.rinput-icon svg {
  width: 16px; height: 16px;
  stroke: currentColor; stroke-width: 1.8; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
.rinput-check {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 14px; pointer-events: none;
}

/* ── Força da senha ── */
.strength-bar {
  height: 3px; background: var(--border);
  border-radius: 2px; margin-top: 8px; overflow: hidden;
}
.strength-fill {
  height: 100%; width: 0;
  border-radius: 2px;
  transition: width .3s, background .3s;
}
.strength-label {
  font-size: 11px; font-family: var(--font-mono);
  color: var(--text-3); margin-top: 4px;
}

/* ── Requisitos de senha ── */
.pass-reqs {
  list-style: none;
  margin: 10px 0 16px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px;
}
.req {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-3);
  font-family: var(--font-mono);
  transition: color .2s;
}
.req.ok { color: var(--green); }
.req-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--border); flex-shrink: 0;
  transition: background .2s;
}
.req.ok .req-dot { background: var(--green); }

/* ── Botão principal ── */
.btn-reg {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px;
  background: var(--accent);
  color: var(--bg);
  border: none; border-radius: 10px;
  font-size: 14px; font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: .3px;
  cursor: pointer;
  transition: opacity .2s, transform .15s, box-shadow .2s;
  box-shadow: var(--shadow-accent);
  margin-bottom: 16px;
  margin-top: 4px;
}
.btn-reg svg {
  width: 16px; height: 16px;
  stroke: currentColor; stroke-width: 2.2; fill: none;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}
.btn-reg:hover  { opacity: .88; box-shadow: var(--shadow-accent), 0 4px 20px var(--accent-glow); }
.btn-reg:active { transform: scale(.98); }
.btn-reg:disabled,
.btn-reg.loading { opacity: .55; pointer-events: none; }

/* ── Botão voltar ── */
.reg-back {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--text-2); font-size: 12.5px;
  font-family: var(--font-body);
  padding: 0; margin-bottom: 18px;
  transition: color .2s;
}
.reg-back:hover { color: var(--text-1); }
.reg-back svg {
  width: 14px; height: 14px;
  stroke: currentColor; stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ── Footer / links ── */
.reg-footer {
  text-align: center; font-size: 12px; color: var(--text-3);
}
.rlink {
  color: var(--accent); cursor: pointer;
  text-decoration: none; transition: opacity .2s;
}
.rlink:hover { opacity: .7; }

/* ── OTP ── */
.otp-hint {
  font-size: 13.5px; color: var(--text-2);
  margin-bottom: 22px; line-height: 1.6;
}
.otp-wrap {
  display: flex; gap: 8px; justify-content: center;
  margin-bottom: 22px;
}
.otp-input {
  width: 46px; height: 54px; text-align: center;
  font-size: 20px; font-weight: 600;
  font-family: var(--font-mono);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px; color: var(--text-1);
  outline: none; caret-color: var(--accent);
  transition: border-color .2s, box-shadow .2s, background .3s;
}
.otp-input:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.otp-input.filled {
  border-color: var(--accent-border);
  background: var(--accent-dim);
}

/* ── Divider ── */
.reg-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 0 10px;
  font-size: 11px; color: var(--text-3);
}
.reg-divider::before, .reg-divider::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border-2);
}

/* ── Sucesso ── */
.success-icon {
  width: 64px; height: 64px; margin: 0 auto 20px;
  background: var(--green-dim);
  border: 1px solid rgba(74,222,128,.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.success-icon svg {
  width: 28px; height: 28px;
  stroke: var(--green); stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ── Toast ── */
.toast-wrap {
  position: fixed; bottom: 22px; right: 22px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13px; color: var(--text-1);
  box-shadow: var(--shadow-card);
  pointer-events: auto;
  animation: toastIn .3s cubic-bezier(.22,1,.36,1) both;
  max-width: 300px;
  font-family: var(--font-body);
}
.toast.out { animation: toastOut .25s ease forwards; }
.toast-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.toast-dot.success { background: var(--green); }
.toast-dot.error   { background: var(--red); }
.toast-dot.warn    { background: var(--amber); }
.toast-dot.info    { background: var(--blue); }

@keyframes toastIn  { from { opacity:0; transform: translateY(8px) scale(.97); } }
@keyframes toastOut { to   { opacity:0; transform: translateY(4px); } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .65s linear infinite; display: inline-block; line-height: 1; }

/* ── Responsivo ── */
@media (max-width: 480px) {
  .reg-card { padding: 28px 20px 22px; }
  .otp-input { width: 40px; height: 48px; font-size: 18px; }
  .pass-reqs { grid-template-columns: 1fr; }
}
