/* Empower Charities — forms, contact actions and phone bar (DerekSol, Nov 2026).
   Colour roles from the UI/UX audit design system: navy #171719, action blue #0f5cfa, text #45454f,
   field border slate #8090a8 (3.24:1 on white), error #b42318, success #0a6c4a. */
:root {
  --ec-navy: #171719; --ec-blue: #171719; --ec-blue-hover: #34343a; --ec-text: #45454f;
  --ec-muted: #5a5a68; --ec-border: #8090a8; --ec-error: #b42318; --ec-success: #0a6c4a; --ec-surface: #f9f9fa;
}

/* ---------- Form ---------- */
.ec-form { display: grid; gap: 18px; text-align: left; }
.ec-form-intro { color: var(--ec-text); font-size: 1rem; line-height: 1.6; margin: 0 0 20px; text-align: left; }
.ec-form-intro strong { color: var(--ec-navy); }
.ec-row { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .ec-row.two { grid-template-columns: 1fr 1fr; } }
.ec-field { display: grid; gap: 6px; }
.ec-field label, .ec-field legend { color: var(--ec-navy); font-weight: 600; font-size: 0.95rem; line-height: 1.3; letter-spacing: normal; }
.ec-field .ec-opt { color: var(--ec-muted); font-weight: 400; }
.ec-field input, .ec-field select, .ec-field textarea {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 1rem; line-height: 1.4; letter-spacing: normal;
  color: #171719; -webkit-text-fill-color: #171719; background: #fff;
  border: 1px solid var(--ec-border); border-radius: 6px; padding: 12px 14px; min-height: 48px; margin: 0;
}
.ec-field textarea { min-height: 140px; resize: vertical; }
.ec-field input::placeholder, .ec-field textarea::placeholder { color: #767684; -webkit-text-fill-color: #767684; opacity: 1; }
.ec-field input:focus-visible, .ec-field select:focus-visible, .ec-field textarea:focus-visible {
  outline: 3px solid var(--ec-navy); outline-offset: 2px; border-color: var(--ec-navy);
}
.ec-hint { color: var(--ec-muted); font-size: 0.875rem; line-height: 1.4; margin: 0; }
.ec-error { color: var(--ec-error); font-size: 0.9rem; line-height: 1.4; margin: 0; display: none; }
.ec-field.is-invalid .ec-error { display: block; }
.ec-field.is-invalid input, .ec-field.is-invalid select, .ec-field.is-invalid textarea { border-color: var(--ec-error); border-width: 2px; }
.ec-choice { display: flex; gap: 20px; flex-wrap: wrap; border: 0; padding: 0; margin: 0; }
.ec-choice label { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ec-text); min-height: 44px; cursor: pointer; }
.ec-choice input { width: 20px; height: 20px; min-height: 0; accent-color: var(--ec-blue); }
.ec-submit {
  justify-self: start; background: var(--ec-blue); color: #fff; -webkit-text-fill-color: #fff; border: 0; border-radius: 999px;
  padding: 14px 28px; min-height: 48px; font: inherit; font-weight: 600; font-size: 1rem; cursor: pointer; letter-spacing: normal;
}
.ec-submit:hover { background: var(--ec-blue-hover); }
.ec-submit:focus-visible { outline: 3px solid var(--ec-navy); outline-offset: 3px; }
.ec-submit[disabled] { opacity: .7; cursor: progress; }
.ec-privacy { color: var(--ec-muted); font-size: 0.875rem; line-height: 1.5; margin: 0; }
.ec-privacy a, .ec-msg a { color: var(--ec-blue); -webkit-text-fill-color: var(--ec-blue); text-decoration: underline; }
.ec-msg { border-radius: 10px; padding: 16px 18px; line-height: 1.55; font-size: 1rem; text-align: left; }
.ec-msg.ok { background: #e9f6f0; color: #0b3d2c; border: 1px solid var(--ec-success); }
.ec-msg.err { background: #fdecea; color: #5c1610; border: 1px solid var(--ec-error); }
.ec-msg strong { display: block; margin-bottom: 4px; }
.ec-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Contact actions (buttons used in boxes) ---------- */
.ec-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.ec-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 24px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none; letter-spacing: normal; box-sizing: border-box;
}
.ec-btn.primary { background: var(--ec-blue); color: #fff; -webkit-text-fill-color: #fff; }
.ec-btn.primary:hover { background: var(--ec-blue-hover); }
.ec-btn.secondary { background: #fff; color: var(--ec-navy); -webkit-text-fill-color: var(--ec-navy); border: 1.5px solid var(--ec-navy); }
.ec-btn.secondary:hover { background: #f2f2f4; }
.ec-btn:focus-visible { outline: 3px solid var(--ec-navy); outline-offset: 3px; }
.ec-btn svg { width: 20px; height: 20px; flex: none; }
.ec-note { color: var(--ec-muted); font-size: 0.9rem; line-height: 1.5; margin: 10px 0 0; letter-spacing: normal; }
.ec-note-light { color: #dfe3ea; -webkit-text-fill-color: #dfe3ea; }

/* ---------- Service page "ask" box and Charity Commission help box ---------- */
.ec-box {
  background: #fff; border: 1px solid #e9e9e9; border-left: 4px solid var(--ec-blue); border-radius: 14px; padding: 24px;
  margin: 32px 0 8px; text-align: left; box-shadow: 0 1px 2px rgb(23 23 25 / .06), 0 2px 6px rgb(23 23 25 / .08);
}
.ec-box h3 { color: var(--ec-navy); -webkit-text-fill-color: var(--ec-navy); font-size: 1.375rem; line-height: 1.3; margin: 0 0 8px; letter-spacing: normal; }
.ec-box p { color: var(--ec-text); -webkit-text-fill-color: var(--ec-text); font-size: 1.0625rem; line-height: 1.6; margin: 0 0 16px; }
.ec-box .ec-price { color: var(--ec-navy); -webkit-text-fill-color: var(--ec-navy); font-weight: 700; }
.ec-box.urgent { border-left-color: #f3e45e; background: #fffef5; }

/* ---------- Phone bar (phones and tablets only) ---------- */
.ec-phonebar { display: none; }
@media (max-width: 991px) {
  .ec-phonebar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgb(255 255 255 / .97); border-top: 1px solid #e9e9e9; box-shadow: 0 -2px 10px rgb(23 23 25 / .10);
    transform: translateY(110%); transition: transform .2s ease-out; visibility: hidden;
  }
  .ec-phonebar.show { transform: none; visibility: visible; }
  .ec-phonebar .ec-btn { flex: 1 1 0; padding: 10px 12px; font-size: .95rem; }
  .ec-phonebar .ec-btn.icon { flex: 0 0 52px; padding: 0; }
  body.ec-has-phonebar { padding-bottom: 72px; }
}
@media (prefers-reduced-motion: reduce) { .ec-phonebar { transition: none; } }
@media (forced-colors: active) { .ec-btn, .ec-submit, .ec-field input, .ec-field select, .ec-field textarea { border: 1px solid CanvasText; } }
.ec-box p a:not(.ec-btn) { color: var(--ec-blue); -webkit-text-fill-color: var(--ec-blue); font-size: inherit; font-weight: 600; text-decoration: underline; word-break: break-word; }
