* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: #f0f4f8;
  padding: 0;
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── State info bar ─────────────────────────────────────── */
.state-info-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.state-info-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.state-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

.status-dot.warning { background: #ff9800; }
.status-dot.error   { background: #f44336; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

.state-info-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.campaign-status {
  background: rgba(255, 255, 255, 0.22);
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 12px;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.system-status {
  font-size: 12px;
  opacity: 0.88;
  white-space: nowrap;
}

/* ── Loading overlay ────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 1rem;
}

.loading-content {
  background: white;
  padding: 2rem 2.5rem;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 380px;
}

.progress-container {
  width: 100%;
  background-color: #ebebeb;
  border-radius: 10px;
  margin: 1rem 0;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 20px;
  background: linear-gradient(90deg, #2b6777, #4a90a4);
  border-radius: 10px;
  transition: width 0.5s ease-in-out;
  position: relative;
}

.progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 11px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

#loading-text {
  color: #2b6777;
  font-weight: bold;
  margin: 0 0 0.75rem;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 1rem;
  font-size: 11px;
  color: #666;
  flex-wrap: wrap;
}

.step {
  flex: 1;
  min-width: 70px;
  padding: 5px 8px;
  border-radius: 14px;
  background: #f0f0f0;
  text-align: center;
  transition: all 0.3s ease;
}

.step.active    { background: #2b6777; color: white; }
.step.completed { background: #4caf50; color: white; }

/* ── Dashboard card ─────────────────────────────────────── */
.dashboard {
  width: 100%;
  max-width: 520px;
  margin: 80px auto 2rem;
  padding: 2rem 2rem 2.25rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
}

@media (max-width: 560px) {
  .dashboard {
    margin: 74px 1rem 1.5rem;
    padding: 1.5rem 1.25rem;
    border-radius: 12px;
  }
}

/* ── Typography ─────────────────────────────────────────── */
h2 {
  color: #2b6777;
  text-align: center;
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
}

p {
  color: #666;
  text-align: center;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

/* ── Form controls ──────────────────────────────────────── */
label {
  display: block;
  font-size: 0.88rem;
  color: #444;
  margin-bottom: 0.35rem;
  font-weight: 500;
}

select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  margin-top: 0.25rem;
  border-radius: 9px;
  border: 1px solid #c8d0d8;
  font-size: 0.97rem;
  outline: none;
  appearance: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23555'%3E%3Cpath d='M5 7l5 5 5-5'/%3E%3C/svg%3E")
    no-repeat right 0.75rem center / 16px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus {
  border-color: #2b6777;
  box-shadow: 0 0 0 3px rgba(43, 103, 119, 0.14);
}

/* ── Info badges ────────────────────────────────────────── */
.info {
  margin-top: 1.25rem;
  text-align: center;
  font-weight: 600;
  color: #2b6777;
  font-size: 0.93rem;
}

/* ── CTA button ─────────────────────────────────────────── */
.go-chat-btn {
  display: block;
  width: 100%;
  text-align: center;
  background-color: #2b6777;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  margin-top: 1.5rem;
  transition: background 0.25s, transform 0.1s;
}

.go-chat-btn:hover {
  background-color: #1d4f5f;
}

.go-chat-btn:active {
  transform: scale(0.98);
}
