/* cas-help modal — patron-facing, matches the CAS 2026 palette + .card radius.
   Submit buttons use the site's .btn .btn-primary classes (see base.css) so
   they inherit the same gold/navy treatment as the rest of cas.dev. */
#cas-help-modal[hidden] { display: none; }
#cas-help-modal { position: fixed; inset: 0; z-index: 9999; }
.cas-help-backdrop { position: absolute; inset: 0; background: rgba(13, 59, 102, 0.5); }
.cas-help-dialog {
  position: relative; max-width: 480px; margin: 8vh auto 0;
  background: #fff; border-radius: 4px; padding: 24px 28px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3); font-family: inherit;
}
.cas-help-close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; font-size: 28px; line-height: 1; cursor: pointer;
}
.cas-help-dialog h2 { margin: 0 0 6px; color: #0d3b66; }
.cas-help-lede { margin: 0 0 16px; color: #555; font-size: 14px; }
#cas-help-modal section[data-panel] { display: none; }
#cas-help-modal[data-state="form"]          section[data-panel="form"],
#cas-help-modal[data-state="confirming"]    section[data-panel="confirming"],
#cas-help-modal[data-state="awaiting"]      section[data-panel="awaiting"],
#cas-help-modal[data-state="chat"]          section[data-panel="chat"],
#cas-help-modal[data-state="closed-banner"] section[data-panel="closed-banner"] { display: block; }
#cas-help-form label { display: block; margin-bottom: 12px; font-size: 13px; }
#cas-help-form input[type="text"], #cas-help-form textarea,
#cas-help-reply-form textarea {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px;
  border: 1px solid #ccc; border-radius: 2px; font: inherit;
}
#cas-help-reply-form { display: flex; gap: 8px; align-items: flex-start; }
#cas-help-reply-form textarea { margin-top: 0; flex: 1; }
.cas-help-contact { border: none; padding: 0; margin: 0 0 12px; }
.cas-help-contact legend { font-size: 13px; margin-bottom: 4px; }
.cas-help-contact label { display: inline-block; margin-right: 12px; }
.cas-help-hp { position: absolute; left: -9999px; }
.cas-help-error { color: #b00020; background: #fde8eb; padding: 8px 12px; border-radius: 2px; margin: 8px 0; }
.cas-help-pill { background: #f6f3ea; padding: 6px 12px; border-radius: 999px; font-size: 13px; display: inline-block; }
.cas-help-transcript { max-height: 280px; overflow-y: auto; margin: 12px 0; padding: 8px; background: #fafafa; border-radius: 2px; }
.cas-help-transcript .msg { margin: 6px 0; padding: 6px 10px; border-radius: 4px; font-size: 14px; }
.cas-help-transcript .msg.patron { background: #e6efff; }
.cas-help-transcript .msg.admin  { background: #f6f3ea; }
.cas-help-transcript .msg.system { background: #eee; color: #666; font-style: italic; }

.cas-nav-help { position: relative; }
.cas-nav-help-dot {
  color: #c19a3a;
  font-size: 20px;
  line-height: 0;
  vertical-align: super;
  margin-left: 2px;
  display: inline-block;          /* required for transform animation */
  transform-origin: center center;
}

/* Pulses when an admin reply is waiting and the modal hasn't been opened
   since it arrived. JS toggles the .is-pulsing class via paintDot(). */
@keyframes cas-help-dot-pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.5); opacity: 0.55; }
}
.cas-nav-help-dot.is-pulsing {
  animation: cas-help-dot-pulse 1.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .cas-nav-help-dot.is-pulsing { animation: none; opacity: 0.7; }
}

.cas-help-contextual {
  background: #fff8e6; border: 1px dashed #c19a3a; border-radius: 4px;
  padding: 14px 18px; margin: 24px 0;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.cas-help-contextual-sub { opacity: 0.7; font-size: 13px; }
