/* =====================================================================
   Suspension, priced courses, redeem codes, support threads
   Loaded after accounts.css.  Everything here is namespaced under a
   class that only the v5 pages emit.
   ===================================================================== */

/* ---------------------------------------------------------------- *
   Suspension notice (suspended.php)
 * ---------------------------------------------------------------- */

.suspended-page { background: var(--bg); }

.suspend-shell {
  max-width: 46rem;
  margin: clamp(2rem, 7vh, 5rem) auto;
}

.suspend-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--bad);
  border-radius: 14px;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  text-align: center;
  box-shadow: 0 18px 50px -28px rgba(4, 10, 24, .55);
}

.suspend-mark {
  display: inline-block;
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: .4rem;
  filter: grayscale(.35);
}

.suspend-card h1 {
  margin: 0 0 .6rem;
  font-size: clamp(1.4rem, 3.4vw, 1.9rem);
  letter-spacing: -.02em;
}

.suspend-lead {
  margin: 0 auto 1.75rem;
  max-width: 34rem;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.65;
}

.suspend-facts {
  display: grid;
  gap: 1px;
  margin: 0 0 1.75rem;
  text-align: left;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.suspend-facts > div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: .8rem 1rem;
  background: var(--card);
  align-items: baseline;
}
.suspend-facts dt {
  color: var(--muted);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.suspend-facts dd { margin: 0; font-size: .93rem; }

.suspend-reason {
  color: var(--text);
  font-weight: 500;
  border-left: 2px solid var(--bad);
  padding-left: .75rem;
}

.suspend-acts {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  align-items: center;
  justify-content: center;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.suspend-foot { margin: 1.5rem 0 0; max-width: 32rem; margin-inline: auto; }

@media (max-width: 34rem) {
  .suspend-facts > div { grid-template-columns: 1fr; gap: .15rem; }
}

/* ---------------------------------------------------------------- *
   Priced course: the two ways forward (course.php)
 * ---------------------------------------------------------------- */

.course-price {
  font-weight: 600;
  color: var(--text);
}

.paid-cta {
  display: grid;
  gap: 1.1rem;
  width: 100%;
}

.paid-wait {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: 10px;
  padding: .95rem 1.1rem;
}
.paid-wait p { margin: .5rem 0 0; font-size: .88rem; }
.paid-wait p.small { font-size: .8rem; }

.paid-ways {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: .9rem;
}

.paid-way {
  display: grid;
  gap: .55rem;
  align-content: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem;
}
.paid-way h3 {
  margin: 0;
  font-size: .96rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.paid-way p { margin: 0; }
.paid-way p.small { font-size: .8rem; line-height: 1.55; }
.paid-way .btn { justify-self: start; margin-top: .2rem; }

/* ---------------------------------------------------------------- *
   Redeem code highlighted inside a message
 * ---------------------------------------------------------------- */

.msg-code {
  margin: .9rem 0;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent) 9%, var(--card)),
    var(--card));
  padding: .8rem .95rem;
}
.msg-code.is-dead {
  border-left-color: var(--txt3);
  background: var(--card);
  opacity: .82;
}

.msg-code-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: .5rem;
}
.code-live { color: var(--ok); }
.code-dead { color: var(--bad); }

.msg-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
}

.msg-code-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(1rem, 2.6vw, 1.3rem);
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: .35rem .7rem;
  user-select: all;
}

/* ---------------------------------------------------------------- *
   Support threads (support.php, admin/support.php)
 * ---------------------------------------------------------------- */

.page-head-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-title { margin: 0 0 .25rem; font-size: 1.5rem; letter-spacing: -.02em; }

.thread-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.thread-list > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}
.thread-list > li > a:hover { border-color: var(--accent); }
.thread-list-main { display: grid; gap: .15rem; min-width: 0; }
.thread-list-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
}
.thread-head {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.25rem;
}
.thread-title { margin: 0 0 .15rem; font-size: 1.15rem; }
.thread-head p { margin: 0; }

.thread-posts { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .8rem; }

.post {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .8rem 1rem;
  max-width: 46rem;
}
.post.is-me {
  background: color-mix(in srgb, var(--accent) 7%, var(--card));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  margin-left: auto;
}
.post.is-them { background: var(--bg); }

.post-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: .35rem;
  font-size: .84rem;
}
.post-body { font-size: .92rem; line-height: 1.6; overflow-wrap: anywhere; }

.thread-reply {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  display: grid;
  gap: .7rem;
  justify-items: start;
}

/* ---------------------------------------------------------------- *
   Admin: payment requests (admin/orders.php)
 * ---------------------------------------------------------------- */

.order-row {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) minmax(12rem, 1.6fr) auto;
  grid-template-areas:
    "who  what  amt"
    "who  act1  act2";
  gap: .35rem .9rem;
  align-items: start;
  padding: .95rem 0;
  border-top: 1px solid var(--line);
}
.order-row:first-of-type { border-top: 0; }

.order-who  { grid-area: who;  display: grid; }
.order-what { grid-area: what; display: grid; }
.order-amt  { grid-area: amt;  text-align: right; white-space: nowrap; }
.order-amt strong { display: block; }
.order-amt .small { display: block; }

.order-act  { display: flex; gap: .5rem; align-items: center; }
.order-act .input { min-width: 11rem; }
.order-btns { flex: none; }

.order-row form:nth-of-type(1) { grid-area: act1; }
.order-row form:nth-of-type(2) { grid-area: act2; }

@media (max-width: 60rem) {
  .order-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "who amt" "what what" "act1 act1" "act2 act2";
  }
  .order-act { flex-direction: column; align-items: stretch; }
  .order-act .input { min-width: 0; width: 100%; }
}

.card-head-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg-btn {
  padding: .32rem .7rem;
  font-size: .8rem;
  color: var(--muted);
  text-decoration: none;
  border-right: 1px solid var(--line);
}
.seg-btn:last-child { border-right: 0; }
.seg-btn.on { background: var(--accent); color: var(--on-acc); font-weight: 600; }

/* ---------------------------------------------------------------- *
   Admin: redeem codes (admin/codes.php)
 * ---------------------------------------------------------------- */

.code-made { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.code-made > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  padding: .55rem .75rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.code-made code {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .09em;
}

.price-input { display: flex; gap: .5rem; }
.price-input select { width: 6.5rem; flex: none; }
.price-input input { flex: 1; }

/* Price chip on the Academy grid */
.lvl-price { margin-left: auto; font-weight: 600; }
.lvl-price.is-free { color: var(--ok); }
.lvl-price.is-paid { color: var(--warn); }

/* ---------------------------------------------------------------- *
   Admin: suspension + permission panels (admin/account.php)
 * ---------------------------------------------------------------- */

.acct-suspend {
  display: grid;
  gap: .9rem;
  margin-bottom: 1rem;
}
.acct-suspend-head {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .9rem;
  align-items: baseline;
}
.acct-suspend-form { max-width: 34rem; }

.acct-suspend-set { margin-bottom: 1rem; }
.acct-suspend-set summary { cursor: pointer; }

.acct-perm {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .8rem 1rem;
  margin-bottom: 1rem;
}

/* Small utilities the new pages lean on.  Defined here rather than in app.css
   because only the v5 pages use them, so they cannot drift out from under the
   older markup. */

.row-gap {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  align-items: center;
}

.input-sm { min-height: 30px; padding: .25rem .5rem; font-size: .82rem; }

/* The roster's per-row reason box: sits inline next to a button, so it must not
   grow the row or push the Manage menu open. */
.manage-row .reason-inline {
  flex: 1;
  min-width: 9rem;
  min-height: 28px;
  padding: .2rem .45rem;
  font-size: .78rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.manage-row .reason-inline::placeholder { color: var(--muted); opacity: .75; }

/* ---------------------------------------------------------------- *
   Admin sidebar live counts
 * ---------------------------------------------------------------- */

.admin-nav .nav-badge {
  display: inline-block;
  margin-left: .35rem;
  padding: 0 .4rem;
  border-radius: 999px;
  background: var(--bad);
  color: var(--bg);
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.5;
  vertical-align: 1px;
}

/* ---------------------------------------------------------------------
   Light theme

   The panels above inherit --panel/--line/--txt from app.css, which is why
   they follow the light palette already.  What does not follow is anything
   painted with a literal, so that is all this block has to correct.
   --------------------------------------------------------------------- */
[data-theme="light"] .suspend-card { box-shadow: 0 18px 50px -34px rgba(20, 30, 60, .35); }
[data-theme="light"] .suspend-facts { background: var(--line); }
[data-theme="light"] .code-made > li,
[data-theme="light"] .manage-row .reason-inline { background: #fbfcfe; }
[data-theme="light"] .post.is-them,
[data-theme="light"] .post.is-me { background: var(--bg2); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
[data-theme="light"] .msg-code-val { background: var(--bg2); }
[data-theme="light"] .seg-btn.on { color: var(--on-acc); }
