/* ═══════════════════════════════════════════════════════════
   CHATI — Design System
   Colors: #004aad (blue) · #8c52ff (purple)
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@300;400;600;700&display=swap');

:root {
  --blue:        #004aad;
  --blue-dark:   #003a8c;
  --blue-light:  #e8f0fb;
  --purple:      #8c52ff;
  --purple-dark: #7340e0;
  --purple-light:#f3eeff;
  --white:       #ffffff;
  --gray-50:     #f8f9fc;
  --gray-100:    #f0f2f8;
  --gray-200:    #e2e6f0;
  --gray-400:    #8892a4;
  --gray-600:    #4a5568;
  --gray-800:    #1a2035;
  --success:     #00b67a;
  --warning:     #f59e0b;
  --error:       #ef4444;

  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body:    'Outfit', sans-serif;

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --shadow-sm:  0 1px 3px rgba(0,74,173,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,74,173,0.12), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:  0 8px 32px rgba(0,74,173,0.16), 0 4px 8px rgba(0,0,0,0.06);
  --shadow-purple: 0 8px 32px rgba(140,82,255,0.25);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Tipografía ─────────────────────────────────────────── */
h1, h2, h3, .display { font-family: var(--font-display); }

/* ── Animaciones ────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.fade-up   { animation: fadeUp 0.45s cubic-bezier(.22,.68,0,1.2) both; }
.fade-in   { animation: fadeIn 0.3s ease both; }
.delay-1   { animation-delay: 0.05s; }
.delay-2   { animation-delay: 0.10s; }
.delay-3   { animation-delay: 0.15s; }
.delay-4   { animation-delay: 0.20s; }
.delay-5   { animation-delay: 0.25s; }

/* ── Spinner ────────────────────────────────────────────── */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--blue-light);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-lg {
  width: 56px; height: 56px;
  border-width: 4px;
}

/* ── Botones ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 14px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  border: none; cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(0,74,173,0.35);
}
.btn-primary:hover { background: var(--blue-dark); box-shadow: 0 6px 20px rgba(0,74,173,0.45); }

.btn-purple {
  background: var(--purple);
  color: var(--white);
  box-shadow: var(--shadow-purple);
}
.btn-purple:hover { background: var(--purple-dark); }

.btn-outline {
  background: transparent;
  color: var(--blue);
  border: 2px solid var(--blue);
}
.btn-outline:hover { background: var(--blue-light); }

.btn-full { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 15px; border-radius: var(--radius-lg); }

.btn:disabled {
  opacity: 0.6; cursor: not-allowed; transform: none;
  box-shadow: none;
}

/* ── Inputs ─────────────────────────────────────────────── */
.input-group { margin-bottom: 14px; }
.input-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.input {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  outline: none;
}
.input::placeholder { color: var(--gray-400); }
.input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,74,173,0.1);
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}
.card-hover { transition: all 0.2s ease; }
.card-hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ── Plan Cards ─────────────────────────────────────────── */
.plan-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 22px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.plan-card:hover {
  border-color: var(--blue);
  box-shadow: 0 6px 24px rgba(0,74,173,0.12);
  transform: translateY(-3px);
}
.plan-card.selected, .plan-card.current {
  border-color: var(--purple);
  background: var(--purple-light);
  box-shadow: var(--shadow-purple);
  transform: translateY(-3px);
}
.plan-check {
  display: none;
  position: absolute; top: 14px; right: 14px;
  width: 22px; height: 22px;
  background: var(--purple);
  border-radius: 50%;
  align-items: center; justify-content: center;
}
.plan-card.selected .plan-check,
.plan-card.current .plan-check { display: flex; }

.plan-badge-current {
  display: none;
  position: absolute; top: -10px; right: 12px;
  background: var(--purple);
  color: var(--white);
  font-size: 10px; font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
}
.plan-card.current .plan-badge-current { display: block; }

.plan-name {
  font-family: var(--font-display);
  font-weight: 700; font-size: 16px;
  color: var(--gray-800);
  margin-bottom: 4px;
}
.plan-price {
  font-family: var(--font-display);
  font-weight: 800; font-size: 22px;
  color: var(--blue);
}
.plan-price span {
  font-size: 12px; font-weight: 400;
  color: var(--gray-400);
}
.plan-features {
  list-style: none;
  margin-top: 12px;
}
.plan-features li {
  font-size: 12px; color: var(--gray-600);
  padding: 2px 0;
}
.plan-features li::before { content: "✓  "; color: var(--success); font-weight: 700; }

/* ── Badges / Tags ──────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}
.badge-active   { background: #e6f9f2; color: #00875a; }
.badge-inactive { background: #fff3e0; color: #e65100; }
.badge-popular  {
  background: var(--purple);
  color: var(--white);
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
}

.channel-tag {
  display: inline-flex; align-items: center;
  padding: 5px 12px;
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid rgba(0,74,173,0.15);
  border-radius: 20px;
  font-size: 12px; font-weight: 600;
  font-family: var(--font-display);
}

/* ── Step Indicators ────────────────────────────────────── */
.step-indicators {
  display: flex; align-items: center; gap: 8px;
  margin-top: 24px;
}
.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  font-family: var(--font-display);
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.step-dot.active {
  background: var(--white);
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.step-dot.done {
  background: rgba(255,255,255,0.9);
  color: var(--blue);
}
.step-line {
  flex: 1; height: 2px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  transition: background 0.4s ease;
}
.step-line.done { background: rgba(255,255,255,0.7); }
.step-label {
  font-size: 11px; color: rgba(255,255,255,0.7);
  font-weight: 500; margin-left: 8px;
  font-family: var(--font-display);
}

/* ── Header Gradient ────────────────────────────────────── */
.chati-header {
  background: linear-gradient(135deg, var(--blue) 0%, #1a6fd4 50%, var(--purple) 100%);
  padding: 32px;
  position: relative;
  overflow: hidden;
}
.chati-header::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ── Logo ───────────────────────────────────────────────── */
.logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
  position: relative;
}
.logo img {
  height: 36px; width: auto;
  filter: brightness(0) invert(1);
}

/* ── Stats Grid ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-value {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 800;
  color: var(--blue);
  line-height: 1;
}
.stat-label {
  font-size: 11px; color: var(--gray-400);
  margin-top: 4px; font-weight: 500;
}

/* ── Alert Banners ──────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}
.alert-success { background: #e6f9f2; border: 1px solid #b3edd8; }
.alert-warning { background: #fff8e6; border: 1px solid #fde68a; }
.alert-error   { background: #fff0f0; border: 1px solid #fecaca; }
.alert-icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }
.alert-title { font-weight: 700; font-size: 13px; font-family: var(--font-display); }
.alert-text  { font-size: 12px; color: var(--gray-600); margin-top: 2px; }

/* ── Section Headers ────────────────────────────────────── */
.section-label {
  font-size: 11px; font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-family: var(--font-display);
  margin-bottom: 12px;
}

/* ── Access Link ────────────────────────────────────────── */
.access-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: var(--blue-light);
  border: 1.5px solid rgba(0,74,173,0.15);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s ease;
}
.access-link:hover {
  background: #dce8f8;
  border-color: var(--blue);
}
.access-url {
  font-family: var(--font-display);
  font-weight: 600; font-size: 14px;
  color: var(--blue);
}

/* ── Inactive State ─────────────────────────────────────── */
.inactive-container {
  max-width: 440px; margin: 0 auto;
  text-align: center; padding: 60px 20px;
}
.inactive-icon {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  font-size: 36px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .chati-header { padding: 24px 20px; }
  .stats-grid   { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-value   { font-size: 20px; }
  .plans-grid   { grid-template-columns: 1fr !important; }
}

/* ── Hidden ─────────────────────────────────────────────── */
.hidden { display: none !important; }
