/* Retenra progression surfaces, premium redesign experiment
   Phase 2. Built only from the Phase 1 tokens and motion layer.
   Gold appears here only through the achievement accent, on
   insignia and unlock moments. Red appears nowhere; nothing in
   progression is an error state. */

.prog-gold-stroke { stroke: var(--achievement); }
.prog-gold-fill { fill: var(--achievement); }

.prog-strip { margin-bottom: var(--space-4); }
.prog-strip-grid {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto minmax(220px, 1.4fr);
  gap: var(--space-4);
  align-items: center;
}
.prog-rank { display: flex; align-items: center; gap: var(--space-3); }
.prog-rank-name { font-weight: 800; font-size: var(--text-body-lg); line-height: var(--leading-tight); }
.prog-rank-sub { color: var(--muted); font-size: var(--text-small); }
.prog-xp-line { display: flex; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-1); }
.prog-xp-line span { color: var(--muted); font-size: var(--text-small); }
.prog-bar {
  display: block; height: 8px; border-radius: var(--radius-pill);
  background: var(--surface-2); overflow: hidden;
}
.prog-bar i {
  display: block; height: 100%; border-radius: var(--radius-pill);
  background: var(--grad-progress);
  transition: width var(--dur-3) var(--ease-out);
}
.prog-streak-chip { display: flex; align-items: center; gap: var(--space-2); }
.prog-streak-num { font-weight: 800; font-size: var(--text-body-lg); line-height: var(--leading-tight); }
.prog-missions { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.prog-mission { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--space-3); align-items: center; }
.prog-mission .prog-bar { grid-column: 1 / -1; height: 5px; }
.prog-mission-label { font-size: var(--text-small); font-weight: 600; }
.prog-mission-prog { color: var(--muted); font-size: var(--text-small); white-space: nowrap; }
.prog-mission.done .prog-mission-label { color: var(--teal); }
.prog-note { color: var(--muted); font-size: var(--text-small); margin: var(--space-3) 0 0; }

.prog-streak-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.prog-cal { display: grid; gap: 4px; max-width: 420px; }
.prog-cal-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.prog-cal-head span { text-align: center; color: var(--muted); font-size: var(--text-caption); }
.prog-cal-day {
  text-align: center; padding: 5px 0; border-radius: var(--radius-xs);
  background: var(--surface-2); color: var(--muted); font-size: var(--text-small);
}
.prog-cal-day.on { background: var(--teal); color: #fff; font-weight: 700; }
.prog-cal-day.today { outline: 2px solid var(--blue); outline-offset: -2px; }
.prog-cal-day.future { opacity: 0.45; }
.prog-goal { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3); flex-wrap: wrap; }
.prog-goal label { font-weight: 600; }
.prog-goal span { color: var(--muted); font-size: var(--text-small); }

.prog-rank-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) 0; border-bottom: 1px solid var(--line);
}
.prog-rank-row:last-child { border-bottom: none; }
.prog-rank-row svg { width: 30px; height: 30px; }
.prog-rank-row-name { font-weight: 700; flex: 1; }
.prog-rank-row-state { color: var(--muted); font-size: var(--text-small); }
.prog-rank-row.current { background: var(--achievement-soft); border-radius: var(--radius-sm); padding-left: var(--space-2); padding-right: var(--space-2); }
.prog-rank-row.current .prog-rank-row-state { color: var(--achievement); font-weight: 700; }

.prog-ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--space-3); }
.prog-tier-head {
  grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline;
  font-weight: 800; font-size: var(--text-body-lg); margin-top: var(--space-4);
  padding-bottom: var(--space-1); border-bottom: 2px solid var(--line);
}
.prog-tier-head:first-child { margin-top: 0; }
.prog-tier-head span { color: var(--muted); font-size: var(--text-small); font-weight: 600; }
.prog-ach {
  display: flex; gap: var(--space-3); padding: var(--space-3);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.prog-ach-icon { flex: none; }
.prog-ach h4 { margin: 0 0 2px; font-size: var(--text-body); }
.prog-ach-criteria { color: var(--muted); font-size: var(--text-small); margin: 0 0 var(--space-2); }
.prog-ach-state { font-size: var(--text-small); color: var(--muted); margin: 0; }
.prog-ach-state.unlocked { color: var(--achievement); font-weight: 700; }
.prog-ach.unlocked { border-color: var(--achievement); background: var(--achievement-soft); }
.prog-ach .prog-bar { margin-top: var(--space-2); height: 5px; }

.prog-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(11, 37, 59, 0.55);
  display: grid; place-items: center; padding: var(--space-4);
  animation: prog-fade var(--dur-2) var(--ease-out) both;
}
.prog-present { max-width: 430px; width: 100%; box-shadow: var(--elev-4); animation: prog-rise var(--dur-3) var(--ease-out) both; }
.prog-present-item { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-2) 0; }
.prog-present-item + .prog-present-item { border-top: 1px solid var(--line); }
@keyframes prog-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes prog-rise { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .prog-strip-grid { grid-template-columns: 1fr 1fr; }
  .prog-missions-wrap { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .prog-overlay, .prog-present { animation: none; }
  .prog-bar i { transition: none; }
}

/* Phase 6 gold discipline: several achievement icons carry the
   achievement accent as one color in their artwork. On a locked
   card that accent renders in the faint tone instead, so gold
   reaches the achievement grid only on the sanctioned surfaces:
   unlocked cards, the current rank row, and the top two rank
   insignias (those gate in the engine, not here). The unlock
   presentation only ever shows unlocked achievements, so it is
   not affected. */
.prog-ach:not(.unlocked) .prog-gold-stroke { stroke: var(--faint); }
.prog-ach:not(.unlocked) .prog-gold-fill { fill: var(--faint); }

/* Phase 5: the weekly goal select is a native control and sat
   under the 44px touch floor. It now matches the form inputs. */
.prog-goal select {
  min-height: 44px;
  font: inherit;
  padding: 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}
