/* Member-facing progression page ("where do I stand").
   Redesigned as a vertical "ascent" timeline. Matches the redesign palette
   used across user-side VTC views. */
.mp-wrap {
    --bg:        #0d0d0e;
    --card:      #151516;
    --hover:     #1b1b1d;
    --line:      rgba(99,99,99,0.25);
    --line-soft: rgba(99,99,99,0.12);
    --ink:       #e0e0e0;
    --ink-dim:   rgba(224,224,224,0.8);
    --ink-faint: rgba(224,224,224,0.65);
    --accent:    #ff9900;
    --green:     #34c759;
    --red:       #ff3b30;
    padding: 1.25rem;
    color: var(--ink);
    display: flex; flex-direction: column; gap: 1rem;
}

.mp-card {
    background: var(--card); border-radius: 0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    overflow: hidden;
    position: relative;
}
.mp-card-h {
    padding: 0.7rem 1rem;
    font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--ink-dim);
    border-bottom: 1px dashed var(--line-soft);
    display: flex; align-items: center; gap: 0.5rem;
}
.mp-card-h::before { content: "▸"; color: var(--accent); }

/* Empty / not-available */
.mp-empty {
    display: flex; flex-direction: column; align-items: center; gap: 0.8rem;
    text-align: center; padding: 2.5rem 1.5rem; color: var(--ink-faint);
}
.mp-empty i { font-size: 2rem; color: var(--accent); opacity: 0.8; }
.mp-empty p { margin: 0; font-size: 0.85rem; max-width: 460px; line-height: 1.5; }

/* ── Role medallion (shared: hero + timeline nodes) ─────────────────── */
.mp-med {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 0;
    flex-shrink: 0;
    background:
        radial-gradient(circle at 30% 25%, rgba(255,255,255,0.06), transparent 60%),
        #1b1b1b;
    box-shadow: inset 0 0 0 1px var(--line-soft);
    overflow: hidden;
}
.mp-med img { width: 100%; height: 100%; object-fit: cover; }
.mp-med i { color: var(--ink-faint); }
.mp-med-lg { width: 52px; height: 52px; border-radius: 0; }
.mp-med-lg i { font-size: 1.15rem; }
.mp-med-xl { width: 84px; height: 84px; border-radius: 0; }
.mp-med-xl i { font-size: 2rem; }

/* A coloured ring around the medallion encodes its rank state. The ring is a
   layered box-shadow so it never clips the circular image. */
.mp-med.is-current  { box-shadow: 0 0 0 2px var(--accent), 0 0 18px rgba(255,153,0,0.45); }
.mp-med.is-target   { box-shadow: 0 0 0 2px rgba(255,153,0,0.55); }
.mp-med.is-achieved { box-shadow: 0 0 0 2px rgba(52,199,89,0.55); }
.mp-med.is-locked   { box-shadow: inset 0 0 0 1px var(--line-soft); opacity: 0.5; }
.mp-med.is-off      { box-shadow: inset 0 0 0 1px var(--line); }
.mp-med-xl.is-current { animation: mp-pulse 2.8s ease-in-out infinite; }

@keyframes mp-pulse {
    0%, 100% { box-shadow: 0 0 0 2px var(--accent), 0 0 0 rgba(255,153,0,0.0); }
    50%      { box-shadow: 0 0 0 2px var(--accent), 0 0 26px rgba(255,153,0,0.55); }
}

/* ── Hero ───────────────────────────────────────────────────────────── */
.mp-hero { padding: 1.3rem 1.3rem 1.2rem; display: flex; flex-direction: column; gap: 1.15rem; }
.mp-hero-glow {
    position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(420px 180px at 12% -10%, rgba(255,153,0,0.12), transparent 70%),
        radial-gradient(380px 200px at 95% 0%, rgba(52,199,89,0.06), transparent 70%);
}
.mp-hero-main {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 1.15rem; flex-wrap: wrap;
}
.mp-hero-id { flex: 1; min-width: 0; }
.mp-hero-label { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-faint); }
.mp-hero-rank { font-size: 1.7rem; font-weight: 800; color: var(--ink); margin: 0.1rem 0 0.5rem; line-height: 1.05; }
.mp-hero-flag {
    display: inline-flex; align-items: center; gap: 0.45rem;
    font-size: 0.74rem; font-weight: 600;
    padding: 0.4rem 0.7rem; border-radius: 0;
}
.mp-hero-flag.is-promote { color: var(--green); background: rgba(52,199,89,0.12); border: 1px solid rgba(52,199,89,0.4); }
.mp-hero-flag.is-demote  { color: var(--accent); background: rgba(255,153,0,0.12); border: 1px solid rgba(255,153,0,0.4); }
.mp-hero-flag.is-steady  { color: var(--ink-dim); background: rgba(255,255,255,0.04); border: 1px solid var(--line); }

.mp-hero-progress {
    text-align: center; flex-shrink: 0;
    padding: 0.55rem 1rem; border-left: 1px solid var(--line-soft);
}
.mp-hero-progress-num { font-size: 1.9rem; font-weight: 800; color: var(--accent); line-height: 1; }
.mp-hero-progress-num span { font-size: 0.95rem; font-weight: 700; color: var(--ink-faint); }
.mp-hero-progress-lbl { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); margin-top: 0.35rem; }
@media (max-width: 560px) { .mp-hero-progress { border-left: 0; padding-top: 0; } }

.mp-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
@media (max-width: 700px) { .mp-stats { grid-template-columns: 1fr; } }
.mp-stat {
    background: var(--bg); border: 1px solid var(--line-soft); border-radius: 0;
    padding: 0.75rem 0.85rem; display: flex; align-items: center; gap: 0.7rem;
}
.mp-stat-ic {
    width: 34px; height: 34px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 0; background: rgba(255,153,0,0.1); color: var(--accent);
    font-size: 0.85rem;
}
.mp-stat-val { font-size: 1.25rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.mp-stat-val span { font-size: 0.78rem; font-weight: 600; color: var(--ink-faint); }
.mp-stat-lbl { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); margin-top: 0.15rem; }

.mp-note {
    position: relative; z-index: 1;
    display: flex; align-items: flex-start; gap: 0.6rem;
    font-size: 0.76rem; line-height: 1.45; color: var(--ink-dim);
    background: rgba(255,255,255,0.03); border: 1px solid var(--line-soft);
    border-radius: 0; padding: 0.7rem 0.85rem;
}
.mp-note i { color: var(--accent); margin-top: 2px; }
.mp-note.is-warn { background: rgba(255,153,0,0.07); border-color: rgba(255,153,0,0.3); }
.mp-activity-body { flex: 1; display: flex; flex-direction: column; gap: 0.4rem; }
.mp-activity-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.mp-activity-val { font-size: 0.7rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* ── Ascent timeline ────────────────────────────────────────────────── */
.mp-asc { padding: 1.1rem 1.1rem 1.3rem; display: flex; flex-direction: column; }

.mp-node {
    display: grid; grid-template-columns: 52px 1fr; gap: 1rem;
    opacity: 0; transform: translateY(10px);
    animation: mp-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--d, 0s);
}
@keyframes mp-rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .mp-node { animation: none; opacity: 1; transform: none; }
    .mp-med-xl.is-current { animation: none; }
}

/* Left rail: medallion + connecting spine segments. */
.mp-node-rail {
    position: relative;
    display: flex; flex-direction: column; align-items: center;
}
.mp-spine { width: 2px; flex: 1; min-height: 12px; background: var(--line-soft); }
.mp-spine.is-hidden { visibility: hidden; }
/* Earned rungs (current + below) light their spine in accent. */
.mp-node.is-earned .mp-spine-bot,
.mp-node.is-earned .mp-spine-top { background: linear-gradient(var(--accent), rgba(255,153,0,0.35)); }
.mp-node.is-current .mp-spine-top { background: linear-gradient(rgba(255,153,0,0.35), var(--accent)); }

/* Right side: the rung card. */
.mp-node-card {
    background: var(--bg); border: 1px solid var(--line-soft); border-radius: 0;
    padding: 0.85rem 1rem; margin-bottom: 0.85rem;
    display: flex; flex-direction: column; gap: 0.75rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.mp-node:last-child .mp-node-card { margin-bottom: 0; }
.mp-node.is-achieved .mp-node-card { border-color: rgba(52,199,89,0.28); }
.mp-node.is-current  .mp-node-card { border-color: rgba(255,153,0,0.55); box-shadow: 0 0 0 1px rgba(255,153,0,0.25), 0 6px 20px rgba(255,153,0,0.08); }
.mp-node.is-target   .mp-node-card { border-color: rgba(255,153,0,0.45); border-style: dashed; }
.mp-node.is-locked   .mp-node-card { opacity: 0.72; }

.mp-rung-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.mp-rung-name { font-size: 1rem; font-weight: 700; color: var(--ink); }
.mp-node.is-locked .mp-rung-name { color: var(--ink-dim); }
.mp-pill {
    display: inline-flex; align-items: center; gap: 0.32rem;
    font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    padding: 0.22rem 0.55rem; border-radius: 0; white-space: nowrap;
}
.mp-pill.is-current  { color: #1a1a1a; background: var(--accent); }
.mp-pill.is-target   { color: var(--accent); background: rgba(255,153,0,0.12); border: 1px solid rgba(255,153,0,0.4); }
.mp-pill.is-achieved { color: var(--green); background: rgba(52,199,89,0.12); border: 1px solid rgba(52,199,89,0.4); }
.mp-pill.is-locked   { color: var(--ink-faint); background: rgba(255,255,255,0.03); border: 1px solid var(--line); }

.mp-rung-reqs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
@media (max-width: 700px) { .mp-rung-reqs { grid-template-columns: 1fr; } }
.mp-req { display: flex; flex-direction: column; gap: 0.32rem; }
.mp-req-top { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; }
.mp-req-label { font-size: 0.66rem; font-weight: 600; color: var(--ink-faint); display: inline-flex; align-items: center; gap: 0.35rem; }
.mp-req-label i { color: var(--ink-faint); font-size: 0.62rem; }
.mp-req.is-met .mp-req-label, .mp-req.is-met .mp-req-label i { color: var(--green); }
.mp-req-val { font-size: 0.68rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.mp-req-val strong { color: var(--ink-dim); font-weight: 700; }
.mp-req.is-met .mp-req-val strong { color: var(--green); }
.mp-req-bar { height: 5px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; }
.mp-req-bar > div { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.4s ease; }
.mp-req.is-met .mp-req-bar > div { background: var(--green); }
.mp-activity .mp-req-bar > div { background: var(--accent); }

/* ── v2 additions ───────────────────────────────────────────────────── */

/* Six stat tiles now (jobs, driving hours and company XP joined the original
   three), so let them reflow instead of forcing three per row. */
.mp-stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
@media (max-width: 700px) { .mp-stats { grid-template-columns: 1fr; } }

/* Staff whose rank sits on the second axis: say plainly that their real role
   is not what is moving. */
.mp-hero-sub {
    display: flex; align-items: center; gap: 0.4rem;
    margin-top: 0.4rem;
    font-size: 0.72rem; color: var(--ink-faint);
}
.mp-hero-sub i { color: var(--ink-faint); }
.mp-hero-sub b { color: var(--ink-dim); }

.mp-hero-flag.is-pinned {
    color: var(--ink-dim);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--line);
}

.mp-note.mp-quota i { color: var(--accent); }

.mp-pill.is-quota {
    color: var(--ink-faint);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--line);
    font-variant-numeric: tabular-nums;
}

/* The bottom rung usually has no thresholds at all; an empty requirements grid
   reads as a rendering bug. */
.mp-req-none {
    grid-column: 1 / -1;
    font-size: 0.72rem; color: var(--ink-faint); font-style: italic;
}

/* Free-text benefits the owner attached to a rung. Not enforced anywhere - the
   app has no personal wallet for a rank to pay into. */
.mp-perks {
    display: flex; align-items: flex-start; gap: 0.5rem;
    margin-top: 0.15rem; padding-top: 0.7rem;
    border-top: 1px dashed var(--line-soft);
    font-size: 0.74rem; color: var(--ink-dim); line-height: 1.45;
}
.mp-perks i { color: var(--accent); margin-top: 2px; flex-shrink: 0; }

/* ── Personal history ───────────────────────────────────────────────── */
.mp-history { padding: 0.4rem 1.1rem 1rem; display: flex; flex-direction: column; }
.mp-history-row {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: 0.78rem; color: var(--ink-dim);
}
.mp-history-row:last-child { border-bottom: 0; }
.mp-history-ic {
    width: 24px; height: 24px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 0.62rem;
}
.mp-history-ic.is-promote { color: var(--green); background: rgba(52,199,89,0.12); }
.mp-history-ic.is-demote  { color: var(--accent); background: rgba(255,153,0,0.12); }
.mp-history-txt { display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.mp-history-txt i { color: var(--ink-faint); font-size: 0.7rem; }
.mp-history-txt b { color: var(--ink); }
.mp-history-when { margin-left: auto; font-size: 0.68rem; color: var(--ink-faint); white-space: nowrap; }

/* ── Public ladder (recruitment pitch for non-members) ──────────────── */
.mp-pitch { padding: 1.1rem; }
.mp-pitch .mp-card-h { padding: 0; border: 0; }
.mp-pitch-lead { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--ink-faint); line-height: 1.5; }
