/* assets/support.css — the support pages (support.php, support-ticket.php): the form, the confirmation with the private link, the
   conversation, the reply and rating forms. Scoped under .ss-support; the only rule outside it is the page background, and only these
   pages load this file. Markup: includes/support_view.php. Behaviour: assets/support.js.

   custom.css makes every link blue with !important and removes the outline of every .btn (the focus ring is set again below).
   Avoid <small>: custom.css forces its size and colour. */

body { background: #f5f8fb; }

.ss-support {
  --ss-sup-ink: #0f2236;
  --ss-sup-text: #2b3d4f;
  --ss-sup-muted: #5b6b7a;
  --ss-sup-line: #dfe7ee;
  --ss-sup-accent: #0b6fa4;
  max-width: 52rem;
  padding-top: 1.5rem;
  padding-bottom: 3.5rem;
  color: var(--ss-sup-text);
}

.ss-support-head { margin: 0 0 1.25rem; }
.ss-support-eyebrow { margin: 0 0 .35rem; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ss-sup-accent); }
.ss-support-head h1 { margin: 0 0 .5rem; font-size: clamp(1.7rem, 4.2vw, 2.4rem); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; color: var(--ss-sup-ink); overflow-wrap: anywhere; }
.ss-support-lead { margin: 0; max-width: 40rem; font-size: 1.05rem; line-height: 1.6; }
.ss-support-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; margin: 0; font-size: .92rem; color: var(--ss-sup-muted); }

.ss-support-card { margin: 0 0 1rem; padding: 1.35rem 1.4rem; border: 1px solid var(--ss-sup-line); border-radius: 1rem; background: #fff; }
.ss-support-card h2 { margin: 0 0 .75rem; font-size: 1.2rem; font-weight: 750; color: var(--ss-sup-ink); }
.ss-support .form-label { font-weight: 600; color: var(--ss-sup-ink); }
/* The border of a field is 3:1 against white (WCAG 1.4.11), a select looks like the other fields (the site paints inputs pale blue), and a
   field with an error is red: the site's own border rule would otherwise win over Bootstrap's .is-invalid. */
.ss-support .form-control, .ss-support .form-select { border: 1px solid #7b8fa1; border-radius: .7rem; padding: .65rem .8rem; }
.ss-support .form-select { background-color: #e9f4ff; }
.ss-support .form-control.is-invalid, .ss-support .form-select.is-invalid { border-color: #b02a37; }
.ss-support .form-control.is-invalid:focus-visible, .ss-support .form-select.is-invalid:focus-visible { outline-color: #b02a37; }
.ss-support textarea.form-control { min-height: 9rem; }
.ss-support-count { margin-top: .25rem; font-size: .82rem; text-align: right; color: var(--ss-sup-muted); }
.ss-support-fine { margin: .75rem 0; font-size: .88rem; line-height: 1.5; color: var(--ss-sup-muted); }
.ss-support-identity { margin: 0 0 1rem; padding: .75rem .9rem; border-radius: .8rem; background: #eef6fb; line-height: 1.5; }
.ss-support-identity i { margin-right: .35rem; color: var(--ss-sup-accent); }

/* The field only a bot fills in: out of sight and out of reach, but not display:none */
.ss-support-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Buttons: the site's blue with white text is 4.1:1, so these pages take the darker blue the links use; custom.css removes every
   .btn outline, so the focus ring is set again here. */
.ss-support .btn-primary { background: #0a58ca; }
.ss-support .btn-primary:hover { background: #0847a3; }
.ss-support a.btn-primary, .ss-support a.btn-primary:hover { color: #fff !important; text-decoration: none; }
.ss-support .btn:focus-visible { outline: 2px solid var(--ss-sup-accent) !important; outline-offset: 2px; box-shadow: none !important; }
/* custom.css recolours a focused or pressed outline button to white on the site's blue (4.1:1): the darker blue instead */
.ss-support .btn-outline-primary:focus, .ss-support .btn-outline-primary:focus-visible, .ss-support .btn-outline-primary:active { background: #0a58ca !important; border-color: #0a58ca !important; color: #fff !important; }
.ss-support .form-control:focus-visible, .ss-support .form-select:focus-visible { outline: 2px solid var(--ss-sup-accent); outline-offset: 1px; }

/* The private link after a ticket was made */
.ss-support-link label { display: block; margin-bottom: .35rem; font-weight: 700; color: var(--ss-sup-ink); }
.ss-support-link .form-control { font-size: .9rem; }
.ss-support-link .btn-primary { margin-top: .25rem; }

/* The status of a ticket */
.ss-support-status { display: inline-block; padding: .15rem .65rem; border-radius: 999px; background: #e6f2fa; color: #0a4e75; font-size: .82rem; font-weight: 700; }
.ss-support-status[data-status="waiting_customer"] { background: #ffefcc; color: #7a4f00; }
.ss-support-status[data-status="in_progress"] { background: #e8e9ff; color: #3730a3; }
.ss-support-status[data-status="resolved"] { background: #dcf5e6; color: #14532d; }
.ss-support-status[data-status="closed"] { background: #e8ecf0; color: #41566a; }

/* The conversation */
.ss-support-thread { display: grid; gap: .8rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.ss-support-msg { max-width: 92%; padding: .9rem 1.05rem; border: 1px solid var(--ss-sup-line); border-radius: 1rem; background: #fff; }
.ss-support-msg.is-you { margin-left: auto; border-color: #bfdcf0; background: #eef6fb; }
.ss-support-msg-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .75rem; margin-bottom: .35rem; font-size: .88rem; color: var(--ss-sup-muted); }
.ss-support-msg-head strong { color: var(--ss-sup-ink); }
.ss-support-msg-body { line-height: 1.65; overflow-wrap: anywhere; }

/* Stars: the radios are in their natural order (1 to 5), so the arrow keys and a screen reader agree with what is drawn. The stars up to
   the chosen one (or the one under the pointer) are filled and darker, an empty star is an outline: colour is not the only cue. Where
   :has() is not supported the radios are simply shown, with their numbers. */
.ss-support-rating { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .6rem; margin-bottom: .3rem; }
.ss-support-rating label { cursor: pointer; }
@supports selector(:has(*)) {
  .ss-support-rating { flex-wrap: nowrap; width: max-content; max-width: 100%; gap: .1rem; }
  .ss-support-rating input { position: absolute; opacity: 0; width: 1px; height: 1px; }
  .ss-support-rating .ss-support-star-num { display: none; }
  .ss-support-rating label { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; font-size: 2rem; line-height: 1; color: #5b6b7a; }
  .ss-support-rating label::before { content: "\2606"; content: "\2606" / ""; }
  .ss-support-rating input:checked + label, .ss-support-rating label:has(~ input:checked), .ss-support-rating label:hover, .ss-support-rating label:has(~ label:hover) { color: #b45f06; }
  .ss-support-rating input:checked + label::before, .ss-support-rating label:has(~ input:checked)::before, .ss-support-rating label:hover::before, .ss-support-rating label:has(~ label:hover)::before { content: "\2605"; content: "\2605" / ""; }
  .ss-support-rating input:focus-visible + label { outline: 2px solid var(--ss-sup-accent); outline-offset: 2px; border-radius: .3rem; }
}
.ss-support-stars { margin: 0; font-size: 1.6rem; letter-spacing: .1em; color: #b45f06; }

/* A member's own requests */
.ss-support-mine ul { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.ss-support-mine li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .7rem .85rem; border: 1px solid var(--ss-sup-line); border-radius: .8rem; }
.ss-support-mine li > div { display: grid; gap: .15rem; min-width: 0; }
.ss-support-mine .ss-support-status { justify-self: start; }
.ss-support-row-subject { overflow-wrap: anywhere; color: var(--ss-sup-ink); }
.ss-support-row-time { font-size: .84rem; color: var(--ss-sup-muted); }

@media (max-width: 575.98px) {
  .ss-support-card { padding: 1.1rem 1rem; }
  .ss-support-msg { max-width: 100%; }
  .ss-support .btn-primary { width: 100%; }
  .ss-support-link .input-group { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .ss-support *, .ss-support *::before, .ss-support *::after { transition: none !important; }
}
