/* ════════════════════════════════════════════════════════════════
   STAIRS AI - Stylesheet
   ════════════════════════════════════════════════════════════════ */

:root {
  --bg: #0b0f1a;
  --card: #12182b;
  --accent: #6cf2c2;
  --accent2: #5aa2ff;
  --danger: #fb7185;
  --text: #e8ebf1;
  --muted: #9aa4bf;
  --stair-bg: rgba(255,255,255,0.05);
  --stair-border: rgba(255,255,255,0.1);
  --stair-active-bg: var(--accent);
  --stair-previous-bg: rgba(90,162,255,0.2);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: Inter, system-ui, sans-serif; }
html, body { width: 100%; overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Login container ── */
#login-container {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

/* ── Main container ── */
.stairs-container {
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 16px 100px;
}
.stairs-container h1 {
  text-align: center;
  font-size: 24px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Subtitle ── */
.bot-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 24px;
}
.subtitle-live {
  color: var(--danger);
  font-size: 12px;
  animation: blink 1.4s infinite;
}

/* ── Card ── */
.bot-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 14px;
  animation: slideInUp 0.5s ease backwards;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.bot-card:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.35); }

/* ── Label ── */
.bot-label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
.label-meta {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

/* ── VIP badge ── */
.bot-vip-badge {
  display: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  margin-bottom: 16px;
}
.bot-vip-badge.show { display: block; }

/* ── Input ── */
.bot-input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 14px;
  margin-bottom: 14px;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.bot-input:focus { outline: none; border-color: rgba(108,242,194,0.4); }
select.bot-input { cursor: pointer; }
select.bot-input option { background: var(--card); color: var(--text); }

/* ── Button ── */
.bot-button {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--bg);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.bot-button:disabled { opacity: 0.45; cursor: not-allowed; }
.bot-button:hover:not(:disabled) { box-shadow: 0 0 20px rgba(108,242,194,0.35); transform: translateY(-1px); }
.bot-button:active:not(:disabled) { transform: scale(0.98); }

/* ── Cooldown ── */
.cooldown-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(251,113,133,0.08);
  border: 1px solid rgba(251,113,133,0.2);
  border-radius: 8px;
}
.cooldown-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cooldown-timer {
  font-size: 14px;
  color: var(--danger);
  font-weight: 700;
  font-family: 'Courier New', monospace;
}

/* ── Session info ── */
.bot-session {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}
.sessionProgress {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}
.sessionProgress div {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: background 0.3s;
}
.sessionProgress div.active { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

/* ── Stairs grid ── */
#stairs-grid {
  margin-top: 8px;
}

/* Single row (Legacy / Adaptive) */
.stairs-single {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: 8px;
}

/* Matrix mode (Quantum Core) */
.stairs-matrix {
  display: grid;
  grid-template-rows: repeat(4, auto);
  gap: 12px;
}
.stairs-matrix-row {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: 8px;
}

/* Stair step cells */
.stair-step {
  background: var(--stair-bg);
  border: 1px solid var(--stair-border);
  color: var(--muted);
  padding: 10px;
  text-align: center;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 40px;
}
.stair-step.previous {
  background: var(--stair-previous-bg);
  color: var(--accent2);
  border-color: var(--accent2);
}
.stair-step.active {
  background: var(--stair-active-bg);
  color: var(--bg);
  font-weight: 700;
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--accent);
}
.stair-step.active::after {
  content: "AI";
  position: absolute;
  top: 4px; right: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--bg);
  opacity: 0.8;
}
.ai-thinking {
  opacity: 0.6;
  filter: blur(0.5px);
  pointer-events: none;
}

/* ── Status rows ── */
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
}
.status-row:last-of-type { border-bottom: none; margin-bottom: 0; }
.status-label { color: var(--muted); }
.status-row strong { color: var(--accent); font-weight: 600; }

/* ── Loader ── */
.loader {
  border: 2px solid rgba(255,255,255,0.1);
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  width: 20px; height: 20px;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  margin: 10px auto 0;
  display: block;
}

/* ── Footer ── */
.bot-footer {
  text-align: center;
  font-size: 11px;
  color: rgba(154,164,191,0.5);
  margin-top: 12px;
  line-height: 1.6;
}

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 480px) {
  .bot-card { padding: 16px; }
  .stair-step { padding: 8px; min-height: 34px; }
}

/* ── Quota urgency ── */
.quota-urgent {
  border-color: rgba(239,68,68,0.4) !important;
  animation: quotaPulse 1.2s ease-in-out infinite;
}
@keyframes quotaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  50% { box-shadow: 0 0 0 6px rgba(239,68,68,0.2); }
}

/* ── Upsell card ── */
.upsell-card {
  text-align: center;
  padding: 24px 20px;
  background: rgba(108,242,194,0.03);
  border: 1px solid rgba(108,242,194,0.12);
  border-radius: 16px;
}
.upsell-icon { font-size: 32px; margin-bottom: 12px; }
.upsell-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.upsell-subtitle { font-size: 14px; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }
.upsell-features {
  list-style: none; padding: 12px 16px; margin: 0 0 16px;
  background: rgba(108,242,194,0.06); border-radius: 10px; text-align: left;
}
.upsell-features li { padding: 5px 0; font-size: 14px; color: var(--text); }
.upsell-social-proof {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 13px; color: var(--muted); margin-bottom: 16px;
}
.upsell-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #22c55e;
  animation: pulse 1.5s ease-in-out infinite;
}
.upsell-cta-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0b0f1a; border: none; border-radius: 12px;
  padding: 14px; font-size: 15px; font-weight: 700;
  cursor: pointer; margin-bottom: 12px;
}
.upsell-cta-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.upsell-back-link { font-size: 13px; color: var(--muted); text-decoration: none; display: block; }
.upsell-back-link:hover { color: var(--text); }

/* ── Social proof line ── */
.social-proof-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text);
  background: rgba(34,197,94,0.07);
  border: 1px solid rgba(34,197,94,0.15);
  border-radius: 20px;
  padding: 6px 14px;
  margin: 8px 0;
}
.social-proof-line::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  display: inline-block;
}

/* ── Floating advisor card ── */
.floating-advisor {
  position: fixed; bottom: 20px; right: 16px;
  width: 160px; background: var(--card);
  border: 1px solid rgba(108,242,194,0.3);
  border-radius: 14px; padding: 14px 14px 12px;
  z-index: 200; text-align: center; font-size: 13px;
}
.floating-advisor-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; color: var(--muted);
  font-size: 16px; cursor: pointer;
}
.floating-advisor-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 8px;
  display: block;
  border: 2px solid rgba(108,242,194,0.3);
}
.floating-advisor-name { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.floating-advisor-status {
  font-size: 12px; color: #22c55e;
  display: flex; align-items: center; justify-content: center; gap: 5px; margin-bottom: 10px;
}
.live-dot-sm {
  width: 6px; height: 6px; border-radius: 50%; background: #22c55e;
  animation: pulse 1.5s ease-in-out infinite;
}
.floating-advisor-btn {
  display: block; background: var(--accent); color: #0b0f1a;
  border-radius: 8px; padding: 7px 12px; font-weight: 600;
  font-size: 13px; text-decoration: none;
}
.advisor-slide-in { animation: slideInUp 0.4s ease; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}