/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}
/* Background image with dark overlay */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('/2.png') center center / cover no-repeat fixed;
  opacity: 0.15;
  z-index: -1;
  pointer-events: none;
}

/* ===== APP CONTAINER ===== */
#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 80px;
}

/* ===== STEP ===== */
.step { display: none; }
.step.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== PROGRESS BAR ===== */
.progress-bar {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 20px;
  padding: 12px 0;
}
.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  background: var(--border);
  color: var(--text-muted);
  transition: all 0.3s;
}
.step-dot.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 0 3px var(--primary-light);
}
.step-dot.completed {
  background: var(--success);
  color: white;
  font-size: 10px;
}

/* ===== CARD ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.card .desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ===== WELCOME ===== */
.welcome-card {
  text-align: center;
  padding: 40px 24px;
}
.welcome-card h1 { font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.welcome-card .subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.welcome-info {
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 24px;
  text-align: left;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}
.welcome-info .small { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.help-text { font-size: 12px; color: var(--text-muted); margin-top: 16px; }

/* ===== SITE HEADER ===== */
.site-header {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: -1;
  opacity: 0.2;
  transition: opacity 0.3s;
}
/* Fully visible only on welcome page */
#app:has(#step-welcome.active) .site-header {
  opacity: 1;
  z-index: 10;
}
.site-header img {
  width: 180px;
  height: auto;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 12px 24px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; transition: all 0.2s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary.btn-large { width: 100%; padding: 16px; font-size: 16px; }
.btn-secondary { background: var(--bg); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary); padding: 10px 20px; font-size: 13px;
}
.btn-outline:hover { background: var(--primary-light); }
.btn-group {
  display: flex; gap: 10px;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.btn-group .btn { flex: 1; }

/* ===== INPUT ===== */
.input-field {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 16px; color: var(--text);
  outline: none; transition: border-color 0.2s;
  margin-bottom: 16px;
}
.input-field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

/* ===== DEVICE SELECTOR ===== */
.device-options { display: flex; gap: 12px; }
.device-card {
  flex: 1; padding: 20px 12px;
  border: 2px solid var(--border); border-radius: var(--radius);
  text-align: center; cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.device-card:hover { border-color: var(--primary); background: var(--primary-light); }
.device-card:active { transform: scale(0.97); }
.device-icon { font-size: 36px; margin-bottom: 8px; }
.device-name { font-size: 16px; font-weight: 700; color: var(--text); }
.device-desc { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ===== INSTRUCTION LIST ===== */
.step-content { margin: 16px 0; }
.instruction-list {
  list-style: none; counter-reset: step-counter;
  padding: 0;
}
.instruction-list li {
  counter-increment: step-counter;
  padding: 12px 16px 12px 44px;
  position: relative;
  font-size: 14px;
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
}
.instruction-list li:last-child { border-bottom: none; }
.instruction-list li::before {
  content: counter(step-counter);
  position: absolute; left: 0; top: 10px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}

/* ===== HIGHLIGHTS & BOXES ===== */
.highlight {
  background: #fef3c7; padding: 2px 8px;
  border-radius: 4px; font-weight: 600;
  font-family: 'SF Mono', 'Courier New', monospace;
  font-size: 13px;
}
.tip-box, .warning-box {
  padding: 14px; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.5; margin-top: 16px;
}
.tip-box { background: var(--success-light); border-left: 3px solid var(--success); }
.warning-box { background: var(--warning-light); border-left: 3px solid var(--warning); }

/* ===== DONE SCREEN ===== */
.done-icon { font-size: 48px; text-align: center; margin-bottom: 8px; }
.done-checklist { margin: 16px 0; }
.check-item {
  padding: 10px 14px;
  font-size: 13px; color: var(--success);
  background: var(--success-light);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

/* ===== WHATSAPP BUTTON ===== */
.wa-toggle {
  position: fixed; bottom: 24px; right: 24px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  transition: all 0.2s;
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.wa-toggle:hover { transform: scale(1.05); }
.wa-toggle:active { transform: scale(0.95); }

/* ===== WA TIP ===== */
.wa-tip {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 16px 20px 70px;
  line-height: 1.5;
}
.wa-tip strong { color: var(--text); }

/* ===== ACCOUNT INFO OVERLAY ===== */
.account-info-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 900;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.account-info-card {
  background: var(--card); border-radius: var(--radius);
  padding: 24px; max-width: 380px; width: 100%;
  box-shadow: var(--shadow-lg);
}
.ai-header { font-size: 16px; font-weight: 700; color: var(--success); margin-bottom: 12px; }
.ai-name { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 16px; }
.ai-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.ai-label { color: var(--text-muted); white-space: nowrap; }
.ai-value { font-weight: 600; color: var(--text); }
.ai-note { font-size: 12px; color: var(--text-muted); margin-top: 12px; padding: 10px; background: var(--warning-light); border-radius: 6px; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--danger); color: white;
  padding: 12px 20px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  z-index: 999; box-shadow: var(--shadow-lg);
  animation: fadeIn 0.2s ease;
  max-width: 90%;
}
@media (max-width: 420px) {
  #app { padding: 12px; }
  .card { padding: 20px 16px; }
  .chat-panel { right: 8px; left: 8px; width: auto; max-height: 70vh; }
  .device-options { flex-direction: column; }
  .device-card { padding: 14px; }
}
