/* Coached. waiver — signing form, signature pad, and the admin views.
   Palette mirrors coached-points.css: ink #16130f, muted #6b6458, accent #e25b2a,
   bg #faf9f7, card #fff, line #e6e2da. */

.cw-wrap{max-width:820px;margin:0 auto;padding:24px 20px 64px;
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;color:#16130f}
.cw-wrap *{box-sizing:border-box}

.cw-wrap h2{font-size:20px;margin:28px 0 6px;letter-spacing:-.01em}
.cw-muted{color:#6b6458;font-size:14px;line-height:1.55;margin:0 0 4px}
.cw-hint{color:#6b6458;font-size:13px;line-height:1.5;margin:6px 0 0}

/* ---------- the document itself ---------- */

.cw-doc{background:#fff;border:1px solid #e6e2da;border-radius:14px;margin:20px 0 8px;overflow:hidden}
.cw-doc-head{display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:12px 16px;border-bottom:1px solid #e6e2da;background:#faf9f7}
.cw-doc-head strong{font-size:13px}
.cw-doc-head a{font-size:12px;color:#e25b2a;font-weight:600;text-decoration:none;white-space:nowrap}
.cw-doc-head a:hover{text-decoration:underline}
.cw-frame{display:block;width:100%;height:760px;border:0;background:#f2f1ee}
.cw-scroll-hint{padding:9px 16px;margin:0;border-top:1px solid #e6e2da;background:#faf9f7;
  font-size:12px;color:#6b6458}

/* ---------- notices ---------- */

.cw-notice{padding:13px 16px;border-radius:12px;margin:0 0 18px;font-size:14px;line-height:1.5}
.cw-notice-ok{background:#f0f8f2;border:1px solid #cfe6d4;color:#14532d}
.cw-notice-error{background:#fdf2f2;border:1px solid #f0cccc;color:#8b1f1f}

/* ---------- the signed banner ---------- */

.cw-signed-card{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;
  background:#f0f8f2;border:1px solid #cfe6d4;border-radius:14px;padding:16px 18px;margin-bottom:6px}
.cw-signed-card h3{margin:0 0 3px;font-size:15px;color:#14532d}
.cw-signed-card p{margin:0;font-size:13px;color:#2f6b45}
.cw-actions{display:flex;gap:10px;margin:0;flex-wrap:wrap}

/* ---------- form ---------- */

.cw-form{margin-top:22px}
.cw-field{margin:0 0 20px}
.cw-field label{display:block;font-size:13px;font-weight:600;margin:0 0 6px}
.cw-req{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#e25b2a;
  margin-left:2px}

.cw-form input[type=text],.cw-form input[type=email],.cw-form input[type=tel],
.cw-form input[type=date],.cw-form textarea{width:100%;padding:10px 12px;font-size:15px;
  font-family:inherit;color:#16130f;background:#fff;border:1px solid #e6e2da;border-radius:8px;
  box-shadow:none;transition:border-color .15s ease}
.cw-form input:focus,.cw-form textarea:focus{outline:none;border-color:#e25b2a;
  box-shadow:0 0 0 3px rgba(226,91,42,.14)}
.cw-form textarea{resize:vertical;line-height:1.5;min-height:64px}

.cw-fieldset{border:1px solid #e6e2da;border-radius:12px;padding:16px 18px;margin:0 0 20px;
  background:#fff}
.cw-fieldset legend{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;
  color:#6b6458;padding:0 8px}
.cw-fieldset .cw-hint{margin:0 0 12px}
.cw-fieldset .cw-field:last-child{margin-bottom:0}

.cw-row{display:grid;grid-template-columns:1fr 1fr;gap:14px}
@media (max-width:520px){.cw-row{grid-template-columns:1fr}}

/* checkbox rows: the tick itself must not stretch */
.cw-check{display:flex;align-items:flex-start;gap:10px;font-weight:400!important;margin:0 0 6px;
  cursor:pointer;line-height:1.5}
.cw-check input[type=checkbox]{width:18px;height:18px;flex:0 0 18px;margin:2px 0 0;accent-color:#e25b2a}
.cw-check span{font-size:14px;color:#16130f}

/* the small inline field used for initials */
.cw-mini{max-width:200px;margin:14px 0 0}
.cw-mini[hidden]{display:none}

/* ---------- signature pad ---------- */

.cw-sign{margin:0}
.cw-pad{background:#fff;border:1px solid #e6e2da;border-radius:12px;padding:10px;transition:border-color .15s ease}
.cw-pad:focus-within{border-color:#e25b2a;box-shadow:0 0 0 3px rgba(226,91,42,.14)}

/* The canvas is stretched to the container width; the JS keeps the backing store
   at 900x240 and rescales stroke coordinates, so the drawn mark survives a resize. */
.cw-canvas{display:block;width:100%;height:auto;aspect-ratio:900/240;background:#fff;
  border-radius:8px;cursor:crosshair;touch-action:none}
.cw-canvas:focus-visible{outline:2px solid #e25b2a;outline-offset:-2px}

/* the signing rule the mark sits on, drawn in CSS so it is never part of the PNG */
.cw-pad-inner{position:relative}
.cw-pad-inner::after{content:'';position:absolute;left:4%;right:4%;bottom:22%;border-bottom:1px solid #d9d4c9;
  pointer-events:none}

.cw-pad-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:8px}
.cw-pad-hint{font-size:12px;color:#6b6458}
.cw-hint-warn{color:#8b1f1f;font-weight:600;margin-top:10px}
.cw-pad-clear{background:none;border:1px solid #e6e2da;border-radius:7px;padding:4px 11px;
  font-size:12px;font-weight:600;font-family:inherit;color:#6b6458;cursor:pointer}
.cw-pad-clear:hover{border-color:#c9c3b6;color:#16130f}
.cw-pad-clear[disabled]{opacity:.4;cursor:default}
.cw-pad.is-signed .cw-pad-hint{color:#1a7f37;font-weight:600}

/* If JS never loads, say so rather than letting someone draw into a dead canvas
   and submit a blank signature. */
.cw-pad.is-dead .cw-pad-hint{color:#8b1f1f;font-weight:600}
.cw-pad.is-dead .cw-canvas{opacity:.45;pointer-events:none;cursor:not-allowed}

/* ---------- guardian block ---------- */

.cw-guardian{margin-top:14px;padding:14px 16px;background:#faf9f7;border:1px solid #e6e2da;
  border-radius:12px}
.cw-guardian[hidden]{display:none}

/* ---------- consent + submit ---------- */

.cw-consent{background:#fff;border:1px solid #e6e2da;border-left:3px solid #e25b2a;border-radius:10px;
  padding:14px 16px;margin:24px 0}

.cw-submit{margin:0 0 8px}
.cw-btn{display:inline-block;padding:12px 24px;border-radius:9px;border:1px solid transparent;
  font-size:15px;font-weight:700;font-family:inherit;text-decoration:none;cursor:pointer;
  transition:background .15s ease,border-color .15s ease}
.cw-btn-primary{background:#e25b2a;color:#fff;border-color:#e25b2a;width:100%}
.cw-btn-primary:hover{background:#cf4f21;border-color:#cf4f21}
.cw-btn-secondary{background:#fff;color:#16130f;border-color:#e6e2da}
.cw-btn-secondary:hover{border-color:#c9c3b6;background:#faf9f7}
.cw-btn[disabled],.cw-btn.is-busy{opacity:.65;cursor:not-allowed}

/* ---------- portal avatar menu status ---------- */

.cw-menu-status{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;
  color:#6b6458}
.cw-menu-status[data-cw-live=signed]{color:#1a7f37}

/* ---------- admin: users list column ---------- */

.cw-pill{display:inline-block;padding:2px 9px;border-radius:10px;font-size:11px;font-weight:700;
  text-transform:uppercase;letter-spacing:.04em;background:#eceae5;color:#6b6458;white-space:nowrap}
.cw-pill-ok{background:#e2f2e7;color:#1a6b3c}

/* ---------- admin: waiver screen ---------- */

.cw-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:16px 0}
.cw-stat{background:#fff;border:1px solid #dcdcde;border-radius:8px;padding:14px 16px}
.cw-stat strong{display:block;font-size:26px;font-weight:600;line-height:1.1;color:#16130f;
  font-variant-numeric:tabular-nums}
.cw-stat span{display:block;margin-top:3px;font-size:12px;color:#646970}

.cw-table code.cw-hash{font-size:11px;background:#f6f7f7;border:1px solid #dcdcde;border-radius:4px;
  padding:1px 5px;color:#646970}

/* ---------- admin: the form must not inherit the front-end width rules ---------- */

.cw-admin .cw-wrap{max-width:none;padding:0;font-family:inherit}

/* ---------- portal: the waiver badge in the top bar ---------- */

/* The red is Element Plus' own danger colour — the exact colour of the
   "Complete your profile (70%)" button the badge sits beside — so the two
   warnings read as one family. The panel colours ride the portal's own
   variables so the dropdown follows dark mode. */

/* ⚠️ Specificity: FluentCommunity styles its own top-menu links with
   `.fcom_user_context_menu_items li.top_menu_item > a { all: unset; ... }`
   at [0,2,2] — an all:unset that destroys any bare class we put on an
   anchor. The alert link therefore carries enough context to win
   per-property ([0,3,2]), and re-declares the whole box, because whatever
   all:unset beats is reset. The menu anchors sit inside a div, out of that
   rule's `>` reach, but `li a { gap: 8px }` still outranks a bare class, so
   those selectors carry context too. */

.cw-portal-waiver{position:relative;display:flex;align-items:center;margin:0 10px 0 0}

.fcom_user_context_menu_items li.cw-portal-waiver > a.cw-waiver-alert{
  display:inline-flex;align-items:center;gap:7px;padding:7px 13px;border-radius:8px;
  background:var(--el-color-danger,#f56c6c);border:1px solid var(--el-color-danger,#f56c6c);
  color:#fff;font-size:13px;font-weight:600;line-height:1;text-decoration:none;
  white-space:nowrap;cursor:pointer;margin:0;vertical-align:middle;
  transition:background .15s ease,border-color .15s ease}
.fcom_user_context_menu_items li.cw-portal-waiver > a.cw-waiver-alert:hover,
.fcom_user_context_menu_items li.cw-portal-waiver > a.cw-waiver-alert:focus-visible{
  background:var(--el-color-danger-light-3,#f78989);
  border-color:var(--el-color-danger-light-3,#f78989);color:#fff;text-decoration:none}
.fcom_user_context_menu_items li.cw-portal-waiver > a.cw-waiver-alert:focus-visible{
  outline:2px solid var(--el-button-outline-color,#a0cfff);outline-offset:1px}
.fcom_user_context_menu_items li.cw-portal-waiver > a.cw-waiver-alert svg{flex:0 0 auto}

/* Signed: quiet, because the member has done what was asked — the point of
   the chip is that the history is one click away, not that it shouts. */
.fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-trigger{
  display:inline-flex;align-items:center;gap:7px;padding:7px 13px;border-radius:8px;
  background:#e2f2e7;border:1px solid #cfe6d4;color:#1a7f37;font-size:13px;font-weight:600;
  line-height:1;font-family:inherit;cursor:pointer;white-space:nowrap;
  transition:background .15s ease,border-color .15s ease}
.fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-trigger:hover{background:#d6ecdd;border-color:#b9dcc1}
.fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-trigger:focus-visible{outline:2px solid #1a7f37;outline-offset:1px}
.fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-trigger .cw-waiver-caret{transition:transform .15s ease}
.fcom_user_context_menu_items .cw-portal-waiver.is-open .cw-waiver-trigger{background:#d6ecdd;border-color:#b9dcc1}
.fcom_user_context_menu_items .cw-portal-waiver.is-open .cw-waiver-caret{transform:rotate(180deg)}

.fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-menu{
  display:none;position:absolute;top:calc(100% + 10px);right:0;z-index:3000;
  min-width:320px;max-width:min(360px,calc(100vw - 24px));padding:6px;border-radius:12px;
  background:var(--fcom-primary-bg,#fff);border:1px solid var(--fcom-primary-border,#e6e2da);
  box-shadow:0 12px 32px -12px rgba(14,18,22,.28),0 4px 12px -8px rgba(14,18,22,.16)}
.fcom_user_context_menu_items .cw-portal-waiver.is-open .cw-waiver-menu{display:block}

.fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-menu-title{
  margin:6px 10px 6px;font-size:11px;font-weight:700;letter-spacing:.05em;
  text-transform:uppercase;color:var(--fcom-secondary-text,#6b6458)}

.fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-item{
  display:flex;flex-direction:column;gap:3px;padding:9px 10px;border-radius:8px;
  text-decoration:none;color:var(--fcom-primary-text,#16130f);
  transition:background .12s ease}
.fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-item:hover,
.fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-item:focus-visible{
  background:var(--fcom-active-bg,#f0f2f5);text-decoration:none}
.fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-item:focus-visible{
  outline:2px solid var(--el-button-outline-color,#a0cfff);outline-offset:-2px}
.fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-item-ref{
  font-size:13px;font-weight:700;font-variant-numeric:tabular-nums;letter-spacing:.02em}
.fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-item-when{
  font-size:12px;color:var(--fcom-secondary-text,#6b6458)}
.fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-item-tag{
  font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;
  margin-top:1px;color:#1a7f37}
.fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-item.is-superseded .cw-waiver-item-ref{
  color:var(--fcom-secondary-text,#6b6458)}
.fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-item.is-superseded .cw-waiver-item-tag{color:#8a8377}

.fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-menu-foot{
  display:block;padding:9px 10px 6px;margin-top:2px;
  border-top:1px solid var(--fcom-primary-border,#e6e2da);border-radius:0 0 8px 8px;
  font-size:12.5px;font-weight:600;color:var(--fcom-text-link,#e25b2a);text-decoration:none}
.fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-menu-foot:hover,
.fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-menu-foot:focus-visible{
  color:var(--fcom-text-link,#e25b2a);text-decoration:underline}

@media (max-width:600px){
  .cw-portal-waiver{margin-right:6px}
  .fcom_user_context_menu_items li.cw-portal-waiver > a.cw-waiver-alert,
  .fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-trigger{padding:6px 10px;font-size:12px}
  .fcom_user_context_menu_items .cw-portal-waiver .cw-waiver-menu{min-width:280px}
}
