/* Jubilee Cell — contact form and consent banner.
   Uses the theme's design tokens when present, with fallbacks so the plugin
   still looks sane if it is ever activated on a different theme. */

.jcc-form-wrap { max-width: 720px; }

.jcc-form__title {
  font-family: var(--jc-font-display, system-ui, sans-serif);
  font-size: var(--jc-h3, 22px);
  color: var(--jc-petrol, #0B2E38);
  margin: 0 0 24px;
}

.jcc-field { margin-bottom: 22px; }

.jcc-field label {
  display: block;
  margin-bottom: 7px;
  font-family: var(--jc-font-body, system-ui, sans-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--jc-petrol, #0B2E38);
}

.jcc-field input,
.jcc-field select,
.jcc-field textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  font-family: var(--jc-font-body, system-ui, sans-serif);
  font-size: 16px; /* 16px stops iOS Safari zooming the page on focus. */
  color: var(--jc-petrol, #0B2E38);
  background: var(--jc-white, #fff);
  /* 3:1 against white — the border is the control's only boundary, so it is a
     UI component under WCAG 1.4.11 and cannot use the decorative pale line. */
  border: 1px solid var(--jc-border-input, #37A0C5);
  border-radius: var(--jc-radius-button, 6px);
  transition: border-color 200ms, box-shadow 200ms;
}

.jcc-field textarea { min-height: 150px; resize: vertical; }

.jcc-field input:focus,
.jcc-field select:focus,
.jcc-field textarea:focus {
  outline: none;
  border-color: var(--jc-deep-cyan, #13647B);
  box-shadow: 0 0 0 4px rgba(105, 203, 231, 0.35);
}

.jcc-field input:focus-visible,
.jcc-field select:focus-visible,
.jcc-field textarea:focus-visible {
  outline: 3px solid var(--jc-petrol, #0B2E38);
  outline-offset: 2px;
}

/* Checkbox row — the target stays at least 24px, and the label is clickable. */
.jcc-checkbox { display: flex; align-items: flex-start; gap: 12px; }

.jcc-checkbox input {
  width: 24px;
  height: 24px;
  min-height: 24px;
  margin: 0;
  flex: none;
  accent-color: var(--jc-deep-cyan, #13647B);
}

.jcc-checkbox label { margin: 0; font-weight: 400; line-height: 1.5; }

.jcc-required { color: #B3261E; font-weight: 700; }

/* Errors carry an icon and text, never colour alone (SC 1.4.1). */
.jcc-field--error input,
.jcc-field--error select,
.jcc-field--error textarea {
  border-color: #B3261E;
  border-width: 2px;
}

.jcc-field__error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 7px 0 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: #B3261E; /* 6.24:1 on white */
}

.jcc-field__error::before { content: "\26A0"; }

.jcc-field__hint {
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--jc-slate, #3D5760);
}

.jcc-form__errors {
  padding: 18px 22px;
  margin-bottom: 28px;
  background: #FCEEEC;
  border: 1px solid #B3261E;
  border-left-width: 4px;
  border-radius: var(--jc-radius-button, 6px);
  color: #7A1A15;
}

.jcc-form__errors ul { margin: 8px 0 0; padding-left: 20px; }
.jcc-form__errors a { color: #7A1A15; }
.jcc-form__errors:focus { outline: 3px solid #B3261E; outline-offset: 3px; }

.jcc-form__success {
  padding: 22px 26px;
  background: var(--jc-cyan-50, #DBF2F9);
  border: 1px solid var(--jc-border, #C9E6F0);
  border-left: 4px solid var(--jc-cyan, #69CBE7);
  border-radius: var(--jc-radius-button, 6px);
  color: var(--jc-petrol, #0B2E38);
  font-size: 16px;
}

.jcc-form__success:focus { outline: 3px solid var(--jc-petrol, #0B2E38); outline-offset: 3px; }
.jcc-form__success p { margin: 0; }

.jcc-form__actions { margin-top: 30px; }

.jcc-form__legal {
  margin-top: 18px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--jc-slate, #3D5760);
}

.jcc-form__legal a { color: var(--jc-deep-cyan, #13647B); }

/* Honeypot: removed from view AND from the accessibility tree, because it is a
   trap for bots and must never be offered to a person. */
.jcc-hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.jcc-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------ Consent banner */
.jcc-consent {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 9998;
  max-width: 560px;
  margin-inline: auto;
  padding: 24px 26px;
  background: var(--jc-white, #fff);
  border: 1px solid var(--jc-border, #C9E6F0);
  border-radius: var(--jc-radius-card, 12px);
  box-shadow: 0 24px 60px -16px rgba(11, 46, 56, 0.28);
  font-family: var(--jc-font-body, system-ui, sans-serif);
}

.jcc-consent__title {
  margin: 0 0 10px;
  font-family: var(--jc-font-display, system-ui, sans-serif);
  font-size: 17px;
  color: var(--jc-petrol, #0B2E38);
}

.jcc-consent__title:focus { outline: none; }

.jcc-consent__text {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--jc-slate, #3D5760);
}

.jcc-consent__text a { color: var(--jc-deep-cyan, #13647B); }

.jcc-consent__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Accept and reject are deliberately the same size and weight. A banner that
   makes refusing harder than accepting does not collect valid consent. */
.jcc-consent__btn {
  flex: 1 1 auto;
  min-height: 48px;
  padding: 12px 22px;
  font-family: var(--jc-font-body, system-ui, sans-serif);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--jc-radius-button, 6px);
  cursor: pointer;
  transition: background 200ms;
}

.jcc-consent__btn--accept {
  background: var(--jc-cyan, #69CBE7);
  border: 1px solid var(--jc-cyan, #69CBE7);
  color: var(--jc-petrol, #0B2E38);
}

.jcc-consent__btn--accept:hover { background: var(--jc-cyan-hover, #39BADF); }

.jcc-consent__btn--reject {
  background: transparent;
  border: 1px solid var(--jc-border-input, #37A0C5);
  color: var(--jc-petrol, #0B2E38);
}

.jcc-consent__btn--reject:hover { background: var(--jc-cyan-50, #DBF2F9); }

.jcc-consent__btn:focus-visible {
  outline: 3px solid var(--jc-petrol, #0B2E38);
  outline-offset: 2px;
}

/* Clear of the theme's sticky CTA bar, and above it in the stack so its
   buttons are always clickable. */
.jcc-consent { z-index: 9999; }
.jcc-consent--above-bar { bottom: 96px; }

@media (max-width: 480px) {
  .jcc-consent { left: 12px; right: 12px; bottom: 12px; padding: 20px; }
  .jcc-consent--above-bar { bottom: 84px; }
  .jcc-consent__actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .jcc-consent, .jcc-consent__btn, .jcc-field input { transition: none; }
}

@media print { .jcc-consent { display: none; } }
