:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0f172a;
  --accent-soft: #1e293b;
  --border: #e2e8f0;
  --ok: #16a34a;
  --warn: #d97706;
  --radius: 12px;
  --shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--accent-soft); text-decoration: none; }
a:hover { text-decoration: underline; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.btn:hover { background: var(--accent-soft); text-decoration: none; }
.btn:disabled {
  opacity: 0.7;
  cursor: wait;
  pointer-events: none;
}
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.auth-card h1 { margin: 0 0 8px; font-size: 1.5rem; }
.auth-card p.sub { margin: 0 0 24px; color: var(--muted); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
}
.field input:focus, .field select:focus { outline: 2px solid #94a3b8; border-color: transparent; }
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-erro { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.tipo-toggle { display: flex; gap: 8px; margin-bottom: 16px; }
.tipo-toggle button {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}
.tipo-toggle button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-lang-switch {
  display: inline-flex;
  gap: 6px;
  margin: 0 auto 14px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.auth-lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.auth-lang-btn:hover { color: var(--text); background: #fff; }
.auth-lang-btn.is-active {
  background: var(--accent);
  color: #fff;
}

.phone-row {
  display: grid;
  grid-template-columns: minmax(132px, 42%) 1fr;
  gap: 8px;
  align-items: stretch;
}
.phone-row .phone-country {
  width: 100%;
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 0.88rem;
  background: #fff;
  cursor: pointer;
  color: var(--text);
}
.phone-row #inp-telefone {
  width: 100%;
  min-width: 0;
}
@media (max-width: 480px) {
  .phone-row {
    grid-template-columns: 1fr;
  }
}

.auth-card-wide { max-width: 520px; }
.auth-card-head { text-align: center; margin-bottom: 8px; }
.auth-card-head h1 { font-size: 1.625rem; }
.auth-form { margin-top: 8px; }
.label-opt { font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.form-actions {
  display: flex;
  justify-content: center;
  margin-top: 28px;
  padding-top: 8px;
}
.btn-submit {
  width: 100%;
  max-width: 320px;
  padding: 14px 24px;
  font-size: 1rem;
}
.auth-footer-link {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
}

.input-pwd {
  position: relative;
  display: flex;
  align-items: stretch;
}
.input-pwd input {
  padding-right: 44px;
}
.pwd-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  opacity: 0.55;
}
.pwd-toggle:hover { opacity: 1; background: #f1f5f9; }
.pwd-toggle::before {
  content: '';
  display: block;
  width: 20px;
  height: 20px;
  margin: 0 auto;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230f172a' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M2.036 12.322a1 1 0 010-.644C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3E%3C/svg%3E");
}
.pwd-toggle.visible::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230f172a' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88'/%3E%3C/svg%3E");
}

.pwd-meter {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.pwd-meter span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
  transition: background 0.2s;
}
.pwd-meter[data-level="0"] span:nth-child(1) { background: #ef4444; }
.pwd-meter[data-level="1"] span:nth-child(-n+2) { background: #f59e0b; }
.pwd-meter[data-level="2"] span:nth-child(-n+3) { background: #eab308; }
.pwd-meter[data-level="3"] span,
.pwd-meter[data-level="4"] span { background: #22c55e; }

.pwd-rules {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.pwd-rules li {
  padding: 3px 0 3px 22px;
  position: relative;
}
.pwd-rules li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  box-sizing: border-box;
}
.pwd-rules li.ok { color: #166534; }
.pwd-rules li.ok::before {
  border-color: #22c55e;
  background: #22c55e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M4.5 9L1.5 6l1-1 2 2 5-5 1 1z'/%3E%3C/svg%3E") center / 10px no-repeat;
}

.field input.input-invalid { border-color: #f87171; outline-color: #fecaca; }
.field input.input-valid { border-color: #86efac; }

.field-hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
  min-height: 1.1em;
  color: var(--muted);
}
.field-hint.is-erro { color: #b91c1c; }
.field-hint.is-ok { color: #15803d; }

.lg-loading {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
.lg-loading[hidden] { display: none !important; }
.lg-loading-panel {
  width: 100%;
  max-width: 320px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
  padding: 32px 28px;
  text-align: center;
  animation: lg-alert-in 0.22s ease-out;
}
.lg-loading-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: lg-spin 0.7s linear infinite;
}
@keyframes lg-spin {
  to { transform: rotate(360deg); }
}
.lg-loading-text {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.lg-loading-sub {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.lg-alert {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}
.lg-alert[hidden] { display: none !important; }
.lg-alert-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
.lg-alert-panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
  padding: 28px 24px 24px;
  text-align: center;
  animation: lg-alert-in 0.22s ease-out;
}
@keyframes lg-alert-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.lg-alert-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #fef2f2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23b91c1c' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28px;
}
.lg-alert-panel.is-ok .lg-alert-icon {
  background-color: #f0fdf4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2315803d' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
}
.lg-alert-title {
  margin: 0 0 8px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}
.lg-alert-message {
  margin: 0 0 20px;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
}
.lg-alert-btn {
  min-width: 140px;
}

.code-box {
  background: #0b1220;
  color: #e2e8f0;
  padding: 16px;
  border-radius: 10px;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.onb-script-ribbon {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
}
.onb-script-ribbon.is-off {
  background: #fef2f2;
  color: #991b1b;
  border-bottom: 2px solid #fecaca;
}
.onb-script-ribbon.is-on {
  background: #ecfdf5;
  color: #047857;
  border-bottom: 2px solid #bbf7d0;
}
.onb-script-ribbon svg { width: 18px; height: 18px; flex-shrink: 0; }
.onb-script-ribbon-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: onb-pulse 1.2s ease-in-out infinite;
}
.onb-script-ribbon-dot.is-on {
  background: #10b981;
  animation: none;
}
@keyframes onb-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}
.onb-detectado-actions { margin-top: 16px; }

.onb-card { max-width: 640px; }
.onb-panel h2 { margin: 0 0 10px; font-size: 1.25rem; }
.onb-panel h3 { margin: 22px 0 8px; font-size: 1rem; }
.onb-lead { margin: 0 0 12px; color: var(--muted); line-height: 1.55; }
.onb-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 0.88rem;
}
.onb-list {
  margin: 0 0 8px;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.92rem;
}
.onb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.onb-form { margin-top: 22px; }
.onb-foot-link {
  margin-top: 18px;
  font-size: 0.88rem;
  text-align: center;
}

.wizard-steps { display: flex; gap: 8px; margin-bottom: 24px; }
.wizard-steps span {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  background: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 600;
}
.wizard-steps span.done { background: #dcfce7; color: #166534; }
.wizard-steps span.current { background: var(--accent); color: #fff; }

.landing header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.landing .hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 32px 48px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.landing .hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.1; margin: 0 0 16px; }
.landing .hero p { color: var(--muted); font-size: 1.125rem; }
.landing .mock {
  background: linear-gradient(145deg, #0f172a, #334155);
  border-radius: 20px;
  min-height: 320px;
  box-shadow: var(--shadow);
  padding: 24px;
  color: #e2e8f0;
}
@media (max-width: 900px) {
  .landing .hero { grid-template-columns: 1fr; }
}