/* ============================================================================
   evoluVia — Sistema de diseño
   Paleta: violeta/índigo como marca, ámbar como acento de energía/CTA.
   Tipografía: system stack (sin fuentes externas, coherente con la CSP).
   ============================================================================ */

:root {
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-500: #6366f1;
  --brand-100: #eef2ff;
  --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #ec4899 100%);

  --accent-500: #f59e0b;
  --accent-600: #d97706;

  --success-500: #10b981;
  --danger-500: #f43f5e;
  --info-500: #0ea5e9;

  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-300: #cbd5e1;
  --ink-100: #f1f5f9;
  --surface: #ffffff;
  --page-bg: #f7f7fb;

  --radius-sm: 0.6rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 10px rgba(15, 23, 42, 0.06), 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 25px rgba(79, 70, 229, 0.15), 0 20px 45px rgba(15, 23, 42, 0.10);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  background: var(--page-bg);
  font-family: var(--font-sans);
  color: var(--ink-900);
}

body { -webkit-font-smoothing: antialiased; }

h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-900);
}

.text-muted { color: var(--ink-500) !important; }

.icon { width: 1.1em; height: 1.1em; vertical-align: -0.15em; flex-shrink: 0; }
.icon-lg { width: 1.6em; height: 1.6em; }
.icon-xl { width: 2.4em; height: 2.4em; }

/* --- Navbar ------------------------------------------------------------- */
.navbar-evoluvia {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.brand-mark {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ink-900) !important;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-mark .brand-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: inline-block;
}

.brand-mark .brand-accent {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-pill {
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid transparent;
  color: var(--ink-700);
  text-decoration: none;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.nav-pill:hover { background: var(--ink-100); color: var(--ink-900); }
.nav-pill.nav-pill-primary { background: var(--brand-600); color: #fff; }
.nav-pill.nav-pill-primary:hover { background: var(--brand-700); color: #fff; }
.nav-pill.nav-pill-accent { background: var(--accent-500); color: #fff; }
.nav-pill.nav-pill-accent:hover { background: var(--accent-600); color: #fff; }
.nav-pill.nav-pill-ghost { border-color: rgba(15, 23, 42, 0.1); }

/* --- Botones ------------------------------------------------------------ */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  padding-block: 0.55rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand-600);
  border-color: var(--brand-600);
}
.btn-primary:hover {
  background: var(--brand-700);
  border-color: var(--brand-700);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.28);
  transform: translateY(-1px);
}

.btn-gradient {
  background: var(--brand-gradient);
  border: none;
  color: #fff;
}
.btn-gradient:hover {
  color: #fff;
  box-shadow: 0 10px 24px rgba(139, 92, 246, 0.35);
  transform: translateY(-1px);
}

.btn-warning, .btn-accent {
  background: var(--accent-500);
  border-color: var(--accent-500);
  color: #fff;
}
.btn-warning:hover, .btn-accent:hover {
  background: var(--accent-600);
  border-color: var(--accent-600);
  color: #fff;
}

.btn-lg { padding: 0.85rem 1.6rem; font-size: 1.05rem; border-radius: var(--radius-md); }
.btn-sm { border-radius: 0.5rem; }

/* --- Cards ---------------------------------------------------------------*/
.card {
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  font-weight: 700;
  color: var(--ink-900);
}

.surface-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.card-clickable {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.card-clickable:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* --- Badges / pills ------------------------------------------------------*/
.badge { border-radius: 999px; font-weight: 600; padding: 0.4em 0.75em; }
.badge.bg-primary-brand { background: var(--brand-100); color: var(--brand-700); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-pill.status-draft { background: #fef3c7; color: #92400e; }
.status-pill.status-published { background: #d1fae5; color: #065f46; }
.status-pill.status-archived { background: var(--ink-100); color: var(--ink-500); }

.status-pill::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}

/* --- Hero / landing ------------------------------------------------------*/
.hero-gradient {
  background: var(--brand-gradient);
  border-radius: var(--radius-lg);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero-gradient::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.25), transparent 45%);
}

.feature-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-100);
  color: var(--brand-600);
}

/* --- Course cards ----------------------------------------------------------*/
.course-cover {
  height: 6rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
}
.course-cover.palette-0 { background: linear-gradient(135deg, #6366f1, #a855f7); }
.course-cover.palette-1 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.course-cover.palette-2 { background: linear-gradient(135deg, #10b981, #0ea5e9); }
.course-cover.palette-3 { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.course-cover.palette-4 { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.course-cover.palette-5 { background: linear-gradient(135deg, #f97316, #f59e0b); }

.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--ink-500);
}
.empty-state .icon-xl { color: var(--ink-300); margin-bottom: 1rem; }

/* --- Question type visual picker ------------------------------------------*/
.type-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.type-card {
  border: 2px solid var(--ink-100);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  background: var(--surface);
}
.type-card:hover { border-color: var(--brand-500); }
.type-card.active {
  border-color: var(--brand-600);
  background: var(--brand-100);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.type-card .icon { width: 1.8rem; height: 1.8rem; color: var(--brand-600); }

/* --- Join code / game visuals ---------------------------------------------*/
.join-code-display {
  font-size: 3rem;
  letter-spacing: 0.5rem;
  font-weight: 800;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.countdown-ring { font-variant-numeric: tabular-nums; }

/* Colores de opciones estilo Kahoot, compartidos entre el diseñador (vista
   previa) y las pantallas de juego (host/jugador). */
.option-color-0 { background-color: #e21b3c; }
.option-color-1 { background-color: #1368ce; }
.option-color-2 { background-color: #d89e00; }
.option-color-3 { background-color: #26890c; }
.option-color-4 { background-color: #864cbf; }
.option-color-5 { background-color: #0f9e93; }

.option-badge {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.drag-handle { cursor: grab; color: var(--ink-300); }
.drag-handle:hover { color: var(--brand-600); }

.sortable-ghost { opacity: 0.35; }

/* --- Utilities ------------------------------------------------------------*/
.bg-brand-soft { background: var(--brand-100); }
.text-brand { color: var(--brand-600); }
.shadow-soft { box-shadow: var(--shadow-sm); }
.rounded-xl { border-radius: var(--radius-md); }

.alert { border-radius: var(--radius-sm); border: none; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger { background: #ffe4e6; color: #9f1239; }
.alert-info { background: #e0f2fe; color: #075985; }
.alert-warning { background: #fef3c7; color: #92400e; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 999px; }
