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

/* ── Variaveis ── */
:root {
  --bg:       #0a0a0a;
  --surface:  #141414;
  --border:   rgba(255,255,255,0.08);
  --text:     #f0f0f0;
  --muted:    #666;
  --accent:   #ff5c28;
  --accent2:  #ff7a4d;
  --green:    #22c55e;
  --red:      #ef4444;
  --radius:   14px;
  --font:     'Inter', -apple-system, sans-serif;
}

/* ── Base ── */
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* ── Telas ── */
.screen {
  display: none;
  min-height: 100dvh;
  padding: 24px 20px 40px;
}
.screen.active { display: block; }

/* ── Container ── */
.container {
  max-width: 440px;
  margin: 0 auto;
}

/* ── Tela PIN ── */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 48px;
  margin-bottom: 8px;
}
.brand-logo {
  width: 52px;
  height: 52px;
  background: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.brand-name {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.5px;
}
.brand-name span {
  color: var(--accent);
}
.brand-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 40px;
}

/* ── Top bar ── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.top-logo {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}
.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 0;
  font-family: var(--font);
}
.btn-link:hover { color: var(--text); }

/* ── Secoes ── */
.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

/* ── Grid de contas ── */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}
.account-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 14px 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.account-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.account-btn.selected {
  background: rgba(255, 92, 40, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Input ── */
.form-group { margin-bottom: 24px; }

.input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  padding: 16px 18px;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
.input::placeholder { color: var(--muted); }
.input:focus { border-color: var(--accent); }

.input-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

/* ── Botoes ── */
.btn {
  width: 100%;
  padding: 17px;
  border-radius: var(--radius);
  border: none;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.2px;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent2); }
.btn-primary:disabled {
  background: var(--surface);
  color: var(--muted);
  border: 1.5px solid var(--border);
  cursor: not-allowed;
}

.btn-cancel {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--muted);
  margin-top: 16px;
}
.btn-cancel:hover { border-color: var(--red); color: var(--red); }

/* ── Mensagens ── */
.msg-error {
  color: var(--red);
  font-size: 14px;
  text-align: center;
  margin-top: 12px;
}
.hidden { display: none !important; }

/* ── Tela Progresso ── */
.progress-header {
  display: flex;
  justify-content: space-between;
  padding: 20px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.progress-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 4px;
}
.progress-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.status-msg {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 14px;
  min-height: 20px;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--surface);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 14px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  width: 0%;
  transition: width 0.4s ease;
}

.count-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}
.count-done { color: var(--green); }
.count-sep  { color: var(--muted); font-size: 20px; }
.count-total { color: var(--text); }
.count-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}
.count-fail {
  font-size: 14px;
  font-weight: 500;
  color: var(--red);
  margin-left: 4px;
}

/* ── Log de progresso ── */
.progress-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 8px;
}
.log-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 10px;
  font-size: 13px;
  animation: fadeIn 0.2s ease;
}
.log-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.log-dot.ok   { background: var(--green); }
.log-dot.fail { background: var(--red); }
.log-text { color: var(--text); flex: 1; }
.log-error { color: var(--red); font-size: 11px; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Tela Concluido ── */
.done-icon {
  width: 72px;
  height: 72px;
  background: rgba(34, 197, 94, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 48px auto 20px;
  color: var(--green);
}
.done-title {
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 32px;
}

.done-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  border: 1.5px solid var(--border);
}
.stat-card.stat-ok  { border-color: rgba(34, 197, 94, 0.3); }
.stat-card.stat-fail { border-color: rgba(239, 68, 68, 0.2); }

.stat-num {
  display: block;
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 4px;
}
.stat-card.stat-ok  .stat-num  { color: var(--green); }
.stat-card.stat-fail .stat-num { color: var(--red); }

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Cookie dot ── */
.account-btn { position: relative; flex-direction: column; gap: 6px; }
.account-name { display: block; }
.cookie-dot {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  margin: 0 auto;
  transition: background 0.2s;
}
.cookie-dot.ok   { background: var(--green); }
.cookie-dot.fail { background: var(--red); }
.cookie-dot.warn { background: #f59e0b; }

/* ── Botao inline ── */
.btn-inline {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* ── Tela config: instrucoes ── */
.config-instructions {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}
.step-num {
  width: 24px;
  height: 24px;
  min-width: 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

/* ── Textarea ── */
.textarea {
  resize: none;
  font-size: 13px;
  font-family: monospace;
  line-height: 1.5;
  min-height: 120px;
}

/* ── Mensagem sucesso ── */
.msg-success {
  color: var(--green);
  font-size: 14px;
  text-align: center;
  margin-top: 12px;
}

/* ── Scroll personalizado ── */
.progress-log::-webkit-scrollbar { width: 4px; }
.progress-log::-webkit-scrollbar-track { background: transparent; }
.progress-log::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Botao testar ── */
.btn-test {
  background: transparent;
  border: 1.5px solid rgba(59,130,246,0.4);
  color: #3b82f6;
  margin-top: 12px;
  font-size: 14px;
  padding: 14px;
}
.btn-test:hover { border-color: #3b82f6; background: rgba(59,130,246,0.08); }
.btn-test:disabled {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}

/* ── Buscar anuncios result ── */
.buscar-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  transition: all .2s;
}
.buscar-result.ok {
  background: rgba(16,185,129,0.1);
  border: 1.5px solid rgba(16,185,129,0.3);
  color: var(--green);
}
.buscar-result.empty {
  background: rgba(239,68,68,0.08);
  border: 1.5px solid rgba(239,68,68,0.25);
  color: var(--red);
}
.buscar-result.loading {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--muted);
}
.buscar-count {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}
.buscar-label { font-weight: 400; color: inherit; opacity: .85; }

.phone-section-hidden { display: none; }
.phone-section-visible { display: block; animation: fadeSlide .25s ease; }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Dry-run result ── */
.dryrun-summary {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dryrun-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.dryrun-label { color: var(--muted); }
.dryrun-val { font-weight: 700; color: var(--text); }
.dryrun-ad-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 10px;
  margin-bottom: 6px;
}
.dryrun-empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
  line-height: 1.6;
}
