/* SEORC help system - styles for help.js. Uses the site's colour tokens from styles.css. */

html.help-big-text { font-size: 118.75%; }
html.help-big-text .site-nav a,
html.help-big-text label,
html.help-big-text .field-note,
html.help-big-text .check-row span { font-size: 1.05em; }

/* ---------- launcher button ---------- */
.help-launcher {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 22px 10px 12px;
  border: 2px solid #fff9eb;
  border-radius: 999px;
  background: var(--field-dark, #174a5a);
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(23, 74, 90, 0.35);
  cursor: pointer;
}
.help-launcher:hover { background: #0f3846; }
.help-launcher:focus-visible { outline: 4px solid var(--gold, #d6ae62); outline-offset: 3px; }
.help-launcher-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold, #d6ae62);
  color: var(--ink, #2e2118);
  font-size: 1.2rem;
  font-weight: 800;
}
body.help-open .help-launcher { display: none; }
/* Leave room at the bottom of the page so the button never covers the footer links. */
.site-footer { padding-bottom: 96px !important; }
/* When the browser jumps to a missed box, stop it hiding under the sticky header. */
form input, form select, form textarea, form .check-row { scroll-margin-top: 120px; }

/* ---------- panel ---------- */
.help-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(46, 33, 24, 0.45);
}
.help-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: min(480px, 100%);
  background: var(--surface, #fff9eb);
  color: var(--ink, #2e2118);
  box-shadow: -12px 0 40px rgba(46, 33, 24, 0.3);
  font-size: 1.05rem;
  line-height: 1.55;
}
.help-panel[hidden], .help-backdrop[hidden] { display: none; }
.help-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 4px solid var(--field, #b86b3d);
  background: var(--paper, #eee3cc);
}
.help-panel-header h2 { margin: 0; font-size: 1.6rem; }
.help-close {
  min-height: 48px;
  padding: 8px 16px;
  border: 2px solid var(--field-dark, #174a5a);
  border-radius: 8px;
  background: #fff;
  color: var(--field-dark, #174a5a);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.help-panel-body {
  overflow-y: auto;
  padding: 8px 20px 32px;
  overscroll-behavior: contain;
}
.help-panel-body section,
.help-panel-body .help-chooser,
.help-panel-body .help-contact { padding: 16px 0; border-bottom: 1px solid var(--line, #cbb995); }
.help-panel h3 { margin: 0 0 10px; font-size: 1.25rem; color: var(--field-dark, #174a5a); }
.help-steps { margin: 0; padding-left: 0; list-style: none; counter-reset: step; }
.help-steps li {
  position: relative;
  margin: 0 0 12px;
  padding-left: 44px;
  counter-increment: step;
}
.help-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--field, #b86b3d);
  color: #fff;
  font-weight: 800;
}
.help-muted { margin: 6px 0; color: var(--muted, #6b5a4a); font-size: 0.95em; }

.help-faq { margin: 0 0 8px; border: 1px solid var(--line, #cbb995); border-radius: 8px; background: #fff; }
.help-faq summary { min-height: 48px; padding: 12px 14px; font-weight: 700; cursor: pointer; }
.help-faq p { margin: 0; padding: 0 14px 14px; }

.help-text-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 0;
  padding: 14px;
  border-radius: 8px;
  background: var(--paper, #eee3cc);
  font-weight: 700;
  cursor: pointer;
}
.help-text-toggle input { width: 26px; height: 26px; accent-color: var(--field-dark, #174a5a); }

.help-big-button {
  display: block;
  margin: 10px 0;
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--field-dark, #174a5a);
  color: #fff;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.help-big-button.secondary { background: #fff; color: var(--field-dark, #174a5a); border: 2px solid var(--field-dark, #174a5a); }

/* ---------- "Which form do I need?" chooser ---------- */
.help-chooser-list { display: grid; gap: 10px; margin: 10px 0; }
.help-choice {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 2px solid var(--line, #cbb995);
  border-left: 6px solid var(--field, #b86b3d);
  border-radius: 8px;
  background: #fff;
  color: var(--ink, #2e2118);
  text-decoration: none;
}
.help-choice:hover, .help-choice:focus-visible { border-color: var(--field-dark, #174a5a); }
.help-choice-q { font-weight: 700; font-size: 1.05em; }
.help-choice-go { color: var(--field-dark, #174a5a); font-weight: 700; text-decoration: underline; }
.help-inline-chooser {
  margin: 0 0 24px;
  padding: clamp(18px, 3vw, 28px);
  border-top: 6px solid var(--field-dark, #174a5a);
  background: var(--surface, #fff9eb);
  box-shadow: var(--shadow);
}
.help-inline-chooser h2 { margin: 0 0 4px; }
@media (min-width: 760px) { .help-inline-chooser .help-chooser-list { grid-template-columns: 1fr 1fr; } }

/* ---------- inside the forms ---------- */
.help-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #e8f1ef;
  border: 1px solid #b9d3cf;
}
.help-start p { margin: 0; flex: 1 1 260px; }
.help-link-button {
  min-height: 44px;
  padding: 8px 16px;
  border: 2px solid var(--field-dark, #174a5a);
  border-radius: 8px;
  background: #fff;
  color: var(--field-dark, #174a5a);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.help-note {
  margin: 0 0 10px;
  padding: 10px 14px;
  border-left: 4px solid var(--gold, #d6ae62);
  background: #fff;
  font-size: 0.95rem;
}

/* "Add another horse" looks and acts like a button (it's still the original tick box underneath) */
.help-as-button.check-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 48px;
  margin-top: 12px;
  padding: 10px 20px;
  border: 2px solid var(--field-dark, #174a5a);
  border-radius: 8px;
  background: #fff;
  color: var(--field-dark, #174a5a);
  font-weight: 700;
  cursor: pointer;
}
.help-as-button.check-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.help-as-button.check-row span::before { content: "+ "; }
.help-as-button.check-row:focus-within { outline: 3px solid var(--gold, #d6ae62); outline-offset: 2px; }

/* Payment box */
.help-bank {
  margin: 16px 0;
  padding: 16px;
  border: 2px solid var(--field-dark, #174a5a);
  border-radius: 10px;
  background: #fff;
}
.help-bank h4 { margin: 0 0 4px; font-size: 1.15rem; color: var(--field-dark, #174a5a); }
.help-bank-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) 1.4fr auto;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line, #cbb995);
}
.help-bank-row:last-of-type { border-bottom: 0; }
.help-bank-row > span { color: var(--muted, #6b5a4a); }
.help-bank-row strong { font-size: 1.1rem; letter-spacing: 0.02em; word-break: break-word; }
.help-ref-value { color: var(--clay, #8f3d28); }
.help-copy {
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--field-dark, #174a5a);
  border-radius: 6px;
  background: #fff;
  color: var(--field-dark, #174a5a);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
@media (max-width: 480px) {
  .help-bank-row { grid-template-columns: 1fr auto; }
  .help-bank-row > span { grid-column: 1 / -1; font-size: 0.9rem; }
}

/* "You missed something" summary */
.help-error-summary {
  margin: 18px 0;
  padding: 16px 18px;
  border: 3px solid #b3261e;
  border-radius: 10px;
  background: #fdecea;
  color: #5f1410;
}
.help-error-summary h4 { margin: 0 0 8px; font-size: 1.15rem; }
.help-error-summary ul { margin: 0; padding-left: 20px; }
.help-error-summary li { margin: 6px 0; }
.help-error-summary a { color: #5f1410; font-weight: 700; }
form [aria-invalid="true"]:not([type="checkbox"]):not([type="radio"]) {
  border-color: #b3261e !important;
  box-shadow: 0 0 0 2px rgba(179, 38, 30, 0.25);
}
form .check-row:has(input[aria-invalid="true"]) { border-color: #b3261e; background: #fdecea; }

/* Submit result messages */
.form-status.help-status-busy { padding: 12px 16px; border-radius: 8px; background: #fff7e0; font-weight: 700; }
.form-status.help-status-success {
  padding: 16px 18px;
  border: 3px solid #2e7d32;
  border-radius: 10px;
  background: #e8f5e9;
  color: #1b4d1e;
  font-size: 1.1rem;
  font-weight: 700;
}
.form-status.help-status-success::before { content: "✓ "; }
.form-status.help-status-error {
  padding: 16px 18px;
  border: 3px solid #b3261e;
  border-radius: 10px;
  background: #fdecea;
  color: #5f1410;
}
.form-status.help-status-error a { color: #5f1410; font-weight: 700; }

@media print { .help-launcher, .help-panel, .help-backdrop { display: none !important; } }

/* ================================================================ */
/* Admin help (admin-help.js)                                        */
/* ================================================================ */
.ahelp-panel { width: min(560px, 100%); }
.ahelp-task { margin: 0 0 8px; border: 1px solid var(--line, #cbb995); border-radius: 8px; background: #fff; }
.ahelp-task > summary {
  min-height: 48px;
  padding: 12px 14px;
  font-weight: 700;
  color: var(--field-dark, #174a5a);
  cursor: pointer;
}
.ahelp-task[open] > summary { border-bottom: 1px solid var(--line, #cbb995); }
.ahelp-task-body { padding: 14px 14px 4px; }
.ahelp-task-body b { color: var(--ink, #2e2118); }
.ahelp-group { margin: 18px 0 8px; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted, #6b5a4a); }
.ahelp-tip { margin: 0 0 12px; padding: 10px 12px; border-left: 4px solid var(--gold, #d6ae62); background: #fffbf0; }
.ahelp-warn { margin: 0 0 12px; padding: 10px 12px; border-left: 4px solid #b3261e; background: #fdecea; color: #5f1410; }
.ahelp-search { display: grid; gap: 6px; margin: 0 0 12px; font-weight: 700; }
.ahelp-search input {
  min-height: 48px;
  padding: 10px 14px;
  border: 2px solid var(--field-dark, #174a5a);
  border-radius: 8px;
  font: inherit;
  font-weight: 400;
}
.ahelp-none { padding: 12px; background: var(--paper, #eee3cc); border-radius: 8px; }
.ahelp-checklist { margin: 0; padding: 0; list-style: none; }
.ahelp-checklist li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 4px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line, #cbb995);
}
.ahelp-when { font-weight: 700; color: var(--field, #b86b3d); }
.ahelp-jump { font-weight: 700; color: var(--field-dark, #174a5a); white-space: nowrap; }
@media (max-width: 480px) { .ahelp-checklist li { grid-template-columns: 1fr; } }
.ahelp-danger { background: #fff6f5; }
.ahelp-undo { margin: 0; padding-left: 20px; }
.ahelp-undo li { margin: 6px 0; }
.ahelp-words { margin: 0; }
.ahelp-words div { padding: 8px 0; border-bottom: 1px solid var(--line, #cbb995); }
.ahelp-words dt { font-weight: 700; }
.ahelp-words dd { margin: 2px 0 0; }

.ahelp-hint {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 10px;
  min-height: 28px;
  border: 1px solid var(--field-dark, #174a5a);
  border-radius: 999px;
  background: #fff;
  color: var(--field-dark, #174a5a);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: middle;
  cursor: pointer;
}
.ahelp-hint:hover { background: var(--field-dark, #174a5a); color: #fff; }
.admin-sidebar .ahelp-sidebar-link { margin-top: 12px; border-top: 1px solid var(--line, #cbb995); }

/* Full guide page */
.ahelp-guide-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 20px; margin: 0 0 20px; }
.ahelp-guide-tools .ahelp-search { flex: 1 1 280px; margin: 0; }
.ahelp-card {
  margin: 0 0 24px;
  padding: clamp(18px, 3vw, 28px);
  border-top: 6px solid var(--field, #b86b3d);
  background: var(--surface, #fff9eb);
  box-shadow: var(--shadow);
  font-size: 1.05rem;
}
.ahelp-card h2 { margin-top: 0; }
@media print {
  .ahelp-guide-tools, .admin-sidebar, .site-header, .site-footer, .ahelp-hint { display: none !important; }
  .ahelp-card { box-shadow: none; break-inside: avoid-page; }
  .ahelp-task { break-inside: avoid; }
}
