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

:root {
  --green: #25D366;
  --green-dark: #128C7E;
  --green-light: #dcf8c6;
  --blue: #4A90E2;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --bg: #f0f4f8;
  --bg-card: #ffffff;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== Header ===== */
.header {
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

/* ===== Steps Nav ===== */
.steps-nav {
  display: flex;
  align-items: center;
  gap: 0;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.3s;
}

.step-dot.active {
  background: var(--green);
  color: white;
}

.step-dot.done {
  background: var(--green-dark);
  color: white;
}

.step-line {
  width: 40px;
  height: 2px;
  background: var(--border);
}

/* ===== Main ===== */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* ===== Steps ===== */
.step { display: none; }
.step.active { display: block; animation: fadeIn 0.3s ease; }

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

/* ===== Step Layout ===== */
.step-layout {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 48px;
  box-shadow: var(--shadow);
}

.step-layout.two-col {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 48px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.step-layout.two-col .step-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

.step-layout.centered,
.step-layout.center-card {
  max-width: 520px;
  margin: 0 auto;
}

/* ===== Step Badge ===== */
.step-badge {
  display: inline-block;
  background: var(--green-light);
  color: var(--green-dark);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.success-badge {
  background: #d1fae5;
  color: #065f46;
}

/* ===== Typography ===== */
h1 { font-size: 2rem; font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 12px; }
h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.lead { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 28px; }
p { color: var(--text-muted); margin-bottom: 16px; }
code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 0.85em; font-family: 'Fira Code', monospace; }
small { color: var(--text-muted); font-size: 0.8rem; }
a { color: var(--green-dark); }

/* ===== App ID Display ===== */
.app-id-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 20px;
}
.app-id-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.app-id-value { font-size: 0.9rem; color: var(--text); }

/* ===== Panel subtitle ===== */
.panel-subtitle { font-size: 0.85rem; color: #94a3b8; margin-bottom: 16px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--green-dark);
  color: white;
}
.btn-primary:hover { background: #0e7065; }
.btn-primary:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }

.btn-secondary {
  background: #f3f4f6;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #e5e7eb; }

.btn-whatsapp {
  background: var(--green);
  color: white;
  font-size: 1rem;
  padding: 14px 28px;
}
.btn-whatsapp:hover { background: #1da851; }
.btn-whatsapp:disabled { background: #9ca3af; cursor: not-allowed; }

.btn-lg { font-size: 1rem; padding: 14px 28px; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

/* ===== Forms ===== */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-group input:focus {
  outline: none;
  border-color: var(--green);
}

.form-group input.readonly {
  background: #f9fafb;
  color: var(--text-muted);
  cursor: default;
}

.input-with-toggle {
  display: flex;
  gap: 8px;
}

.input-with-toggle input { flex: 1; }

.toggle-btn {
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 1rem;
}

.help-btn {
  background: none;
  border: 1px solid var(--blue);
  color: var(--blue);
  border-radius: 100px;
  padding: 2px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  margin-left: auto;
}

/* ===== Info/Warning Boxes ===== */
.help-box, .warning-box, .info-box, .error-box, .tip-box {
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.85rem;
  margin-top: 8px;
}

.help-box { background: #eff6ff; border-left: 3px solid var(--blue); color: #1e40af; }
.warning-box { background: #fef2f2; border-left: 3px solid #f87171; color: #991b1b; margin-top: 12px; }
.warning-orange { background: #fff7ed; border-left: 3px solid #f97316; color: #9a3412; }
.info-box { background: #f0fdf4; border-left: 3px solid var(--green); color: #166534; margin-top: 8px; }
.error-box { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.tip-box { background: #f8fafc; border: 1px solid var(--border); color: var(--text); margin-top: 16px; }

/* ===== Instructions Panel ===== */
.instructions-panel {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 32px;
}

.instructions-panel h3 { color: white; margin-bottom: 20px; }

.instruction-list {
  list-style: none;
  counter-reset: step-counter;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.instruction-list li {
  display: flex;
  gap: 14px;
  counter-increment: step-counter;
}

.instruction-list li::before {
  content: counter(step-counter);
  background: var(--green);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.instruction-list strong { display: block; color: white; font-size: 0.9rem; margin-bottom: 2px; }
.instruction-list span { font-size: 0.83rem; color: #94a3b8; line-height: 1.5; }
.instruction-list a { color: var(--green); }
.instruction-list code { background: #334155; color: #93c5fd; }
.instruction-list em { font-style: italic; color: #fbbf24; }

/* ===== Signup Area ===== */
.signup-area { display: flex; flex-direction: column; gap: 20px; margin: 20px 0; }

.signup-steps-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.signup-steps-list li { font-size: 0.9rem; }

/* ===== Captured Data ===== */
.captured-data {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 16px 0;
}

.captured-data h3 { color: #166534; font-size: 0.95rem; margin-bottom: 12px; }
.captured-item { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; margin-bottom: 6px; }
.captured-item span { color: var(--text-muted); min-width: 140px; }

/* ===== Timeline ===== */
.timeline { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }

.timeline-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.timeline-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.timeline-item strong { display: block; color: white; font-size: 0.88rem; }
.timeline-item span { font-size: 0.82rem; color: #94a3b8; }

/* ===== Progress Steps ===== */
.progress-steps { display: flex; flex-direction: column; gap: 12px; margin: 28px 0; }

.progress-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #f9fafb;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  transition: all 0.3s;
}

.progress-item.active {
  border-color: var(--green);
  background: #f0fdf4;
}

.progress-item.done {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.progress-item.error {
  border-color: #fecaca;
  background: #fef2f2;
}

.progress-icon { font-size: 1.3rem; flex-shrink: 0; width: 28px; text-align: center; }
.progress-text strong { display: block; font-size: 0.9rem; margin-bottom: 2px; }
.progress-text span { font-size: 0.82rem; color: var(--text-muted); }

/* ===== JSON Output ===== */
.json-container {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 20px 0;
}

.json-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1e293b;
  color: #e2e8f0;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-family: monospace;
}

.json-output {
  background: #0f172a;
  color: #a5f3fc;
  padding: 20px;
  font-size: 0.82rem;
  font-family: 'Fira Code', 'Courier New', monospace;
  overflow-x: auto;
  white-space: pre;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.6;
}

.copy-msg {
  color: #166534;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

/* ===== Final Info ===== */
.final-info { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .step-layout.two-col { grid-template-columns: 1fr; }
  .instructions-panel { order: -1; }
  .steps-nav { display: none; }
  .step-layout { padding: 24px; }
  h1 { font-size: 1.5rem; }
}
