/* index.css — pantalla de selecció de curs */

.index-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.index-wrap {
  width: 100%;
  max-width: 480px;
  padding: 32px 20px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ── Capçalera ─────────────────────────────────────────────────────── */
.index-header {
  text-align: center;
  margin-bottom: 40px;
}

.index-logo {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
  font-size: 18px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(46,117,182,.30);
}

.index-header h1 {
  font-size: 24px; font-weight: 800;
  color: var(--navy); margin-bottom: 6px;
}

.index-header p {
  font-size: 14px; color: var(--muted);
}

/* ── Pregunta ──────────────────────────────────────────────────────── */
.index-prompt {
  font-size: 13px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--hint);
  margin-bottom: 14px;
  align-self: flex-start;
}

/* ── Targetes de curs ──────────────────────────────────────────────── */
.index-cards {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.course-card {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--sh);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .14s, box-shadow .14s, transform .12s;
}

.course-card:hover {
  border-color: var(--blue);
  box-shadow: var(--sh-md);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--ink);
}

.cc-badge {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 11px;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 15px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}

.course-card:hover .cc-badge {
  background: var(--blue);
  color: #fff;
}

.cc-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}

.cc-title {
  font-size: 16px; font-weight: 700; color: var(--navy);
}

.cc-sub {
  font-size: 13px; color: var(--muted);
}

.cc-arrow {
  flex-shrink: 0;
  width: 16px; height: 16px;
  color: var(--hint);
  transition: color .14s, transform .14s;
}

.course-card:hover .cc-arrow {
  color: var(--blue);
  transform: translateX(2px);
}

/* ── Targeta desactivada (curs encara no iniciat) ───────────────────── */
.course-card.is-disabled {
  cursor: default;
  color: var(--hint);
  border-style: dashed;
  box-shadow: none;
}
.course-card.is-disabled .cc-badge { background: var(--line-2); color: var(--hint); }
.course-card.is-disabled .cc-title { color: var(--muted); }
.course-card.is-disabled:hover {
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}
.course-card.is-disabled:hover .cc-badge { background: var(--line-2); color: var(--hint); }

/* ── Topbar de l'índex (dropdown Continguts) ───────────────────────── */
.index-page { position: relative; }

.index-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px;
  padding: 0 16px; height: 54px;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}

/* ── Dropdown Continguts ───────────────────────────────────────────── */
.continguts-wrap { position: relative; }
.continguts-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 980px;
  font-size: 13px; font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: background .12s, color .12s, border-color .12s;
  white-space: nowrap;
  cursor: pointer;
}
.continguts-btn svg { width: 15px; height: 15px; }
.continguts-btn:hover { border-color: var(--navy); color: var(--navy); }
.continguts-wrap.is-open .continguts-btn {
  background: var(--card);
  border-color: var(--blue);
  color: var(--navy);
}
.continguts-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px; max-width: 90vw;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--sh-md);
  padding: 6px;
  z-index: 60;
}
.continguts-menu[hidden] { display: none; }
.config-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.config-item:hover { background: var(--blue-bg); text-decoration: none; }
.config-item svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
