/* ============================================================================
 * 4J INSURANCE BROKERAGE — CTA + INTENT SYSTEM STYLES
 * Brand Guidelines v1.0 (amended): Newsreader display, Open Sans UI.
 * Gold is a restrained accent. Navy carries the system.
 * Primary button = Strategy Gold background with Midnight Navy text (6.5:1).
 * White text on Strategy Gold is never used.
 * Version 1.0.0
 * ==========================================================================*/

:root {
  --j4-navy:      #09152B;  /* Midnight Navy   */
  --j4-navy-2:    #18233B;  /* Executive Navy  */
  --j4-slate:     #303F59;  /* Structural Slate*/
  --j4-gold:      #C0950E;  /* Strategy Gold   */
  --j4-gold-dark: #A67F0B;
  --j4-parchment: #F3EDDF;
  --j4-white:     #F8F7F4;  /* Warm White      */
  --j4-radius:    2px;
  --j4-tap:       44px;
  --j4-ui:        'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --j4-display:   'Newsreader', Georgia, 'Times New Roman', serif;
  --j4-shadow:    0 18px 48px rgba(9, 21, 43, 0.28);
}

/* ---------------------------------------------------------------- BUTTONS */

.j4-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--j4-tap);
  padding: 12px 26px;
  font-family: var(--j4-ui);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--j4-radius);
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
  -webkit-appearance: none;
  appearance: none;
}

.j4-btn--primary {
  background-color: var(--j4-gold);
  border-color: var(--j4-gold);
  color: var(--j4-navy);
}
.j4-btn--primary:hover,
.j4-btn--primary:focus-visible {
  background-color: var(--j4-gold-dark);
  border-color: var(--j4-gold-dark);
  color: var(--j4-navy);
}

.j4-btn--outline {
  background-color: transparent;
  border-color: var(--j4-navy);
  color: var(--j4-navy);
}
.j4-btn--outline:hover,
.j4-btn--outline:focus-visible {
  background-color: var(--j4-navy);
  color: var(--j4-white);
}

.j4-btn--ghost {
  background-color: transparent;
  border-color: var(--j4-slate);
  color: var(--j4-navy);
}
.j4-btn--ghost:hover { background-color: rgba(48, 63, 89, .08); }

/* ---------------------------------------------------------------------------
   ANCHOR HARDENING
   Some of these buttons are rendered as <a> (the meeting link in the success
   state, the no-JS fallback in the CTA module). The Elevate theme styles bare
   anchors with the brand link colour and its stylesheet loads AFTER this file,
   so a plain `.j4-btn--primary { color: ... }` loses and you get gold text on
   a gold button — invisible. These selectors match the anchor states
   explicitly so the button colour always wins. Do not simplify them.
------------------------------------------------------------------------- */
a.j4-btn.j4-btn--primary,
a.j4-btn.j4-btn--primary:link,
a.j4-btn.j4-btn--primary:visited,
a.j4-btn.j4-btn--primary:hover,
a.j4-btn.j4-btn--primary:focus,
a.j4-btn.j4-btn--primary:active     { color: var(--j4-navy); }

a.j4-btn.j4-btn--outline,
a.j4-btn.j4-btn--outline:link,
a.j4-btn.j4-btn--outline:visited,
a.j4-btn.j4-btn--outline:active     { color: var(--j4-navy); }
a.j4-btn.j4-btn--outline:hover,
a.j4-btn.j4-btn--outline:focus      { color: var(--j4-white); }

a.j4-btn.j4-btn--ghost,
a.j4-btn.j4-btn--ghost:link,
a.j4-btn.j4-btn--ghost:visited,
a.j4-btn.j4-btn--ghost:hover,
a.j4-btn.j4-btn--ghost:focus,
a.j4-btn.j4-btn--ghost:active       { color: var(--j4-navy); }

a.j4-linkbtn,
a.j4-linkbtn:link,
a.j4-linkbtn:visited,
a.j4-linkbtn:hover,
a.j4-linkbtn:focus,
a.j4-linkbtn:active                 { color: var(--j4-navy); }

.j4-btn--block { width: 100%; }
.j4-btn[disabled] { opacity: .6; cursor: default; }

/* On dark bands the outline button reverses. */
.j4-on-dark .j4-btn--outline { border-color: var(--j4-white); color: var(--j4-white); }
.j4-on-dark .j4-btn--outline:hover { background-color: var(--j4-white); color: var(--j4-navy); }

.j4-linkbtn {
  display: inline-block;
  background: none;
  border: 0;
  padding: 10px 2px;
  min-height: var(--j4-tap);
  font-family: var(--j4-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--j4-navy);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  cursor: pointer;
}
.j4-linkbtn:hover { color: var(--j4-slate); }
.j4-linkbtn--inline { min-height: 0; padding: 0; }

/* Focus is always visible, on every interactive element.
   Two-tone on purpose. Strategy Gold alone against a light surface measures
   2.60:1, which fails WCAG 2.2 SC 1.4.11 (3:1 for a focus indicator). The
   Midnight Navy ring carries the contrast at 16.99:1 and the gold halo carries
   the brand. On dark surfaces the ring reverses to Warm White. */
.j4-btn:focus-visible,
.j4-linkbtn:focus-visible,
.j4-intent-option:focus-visible,
.j4-input:focus-visible,
.j4-checkbox:focus-visible + .j4-checklabel,
.j4-radio:focus-visible + .j4-pill,
.j4-modal-close:focus-visible {
  outline: 3px solid var(--j4-navy);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(192, 149, 14, .45);
}

.j4-on-dark .j4-btn:focus-visible,
.j4-on-dark .j4-linkbtn:focus-visible,
.j4-sticky .j4-btn:focus-visible {
  outline-color: var(--j4-white);
  box-shadow: 0 0 0 6px rgba(192, 149, 14, .55);
}

/* --------------------------------------------------------- INLINE CTA BLOCK */

.j4-ctablock {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0;
}
.j4-ctablock--primary { align-items: flex-start; }

.j4-micro {
  margin: 0;
  font-family: var(--j4-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--j4-slate);
  max-width: 46ch;
}
.j4-micro--under { margin-top: -2px; }
.j4-on-dark .j4-micro { color: rgba(248, 247, 244, .82); }

/* ------------------------------------------------------------ MOBILE STICKY */

.j4-sticky {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 9998;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--j4-navy);
  border-top: 1px solid rgba(192, 149, 14, .5);
  transform: translateY(110%);
  transition: transform .22s ease;
  display: none;
}
.j4-sticky { visibility: hidden; }
.j4-sticky.is-visible { transform: translateY(0); visibility: visible; }

@media (max-width: 900px) {
  .j4-sticky { display: block; }
  body.j4-has-sticky { padding-bottom: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .j4-sticky { transition: none; }
}

/* -------------------------------------------------------------------- MODAL */

body.j4-modal-open { overflow: hidden; }

.j4-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(9, 21, 43, .62);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.j4-modal-panel {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: auto;
  background: var(--j4-white);
  border-top: 3px solid var(--j4-gold);
  border-radius: var(--j4-radius);
  box-shadow: var(--j4-shadow);
  padding: 40px 40px 32px;
}
.j4-modal-panel--drawer { max-width: 560px; }

@media (max-width: 640px) {
  .j4-modal-overlay { padding: 0; }
  .j4-modal-panel { max-width: none; min-height: 100%; padding: 56px 20px 28px; margin: 0; }
}

.j4-modal-close {
  position: absolute;
  top: 8px; right: 8px;
  width: var(--j4-tap); height: var(--j4-tap);
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0;
  font-size: 30px; line-height: 1;
  color: var(--j4-slate);
  cursor: pointer;
}
.j4-modal-close:hover { color: var(--j4-navy); }

/* --------------------------------------------------------------- TYPOGRAPHY */

.j4-modal-panel .j4-h2 {
  margin: 0 0 8px;
  font-family: var(--j4-display);
  font-weight: 500;
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.14;
  letter-spacing: -0.015em;
  color: var(--j4-navy);
  outline: none;
}
.j4-modal-panel .j4-h2::after {
  content: '';
  display: block;
  width: 44px;
  height: 2px;
  margin-top: 14px;
  background: var(--j4-gold);
}
.j4-modal-panel .j4-h3 {
  margin: 0 0 10px;
  font-family: var(--j4-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--j4-navy);
}
.j4-modal-panel .j4-body {
  margin: 12px 0 0;
  font-family: var(--j4-ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--j4-slate);
}
.j4-disclaimer {
  margin: 18px 0 0;
  font-family: var(--j4-ui);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--j4-slate);
  opacity: .78;
}
.j4-footnote {
  margin: 14px 0 0;
  font-family: var(--j4-ui);
  font-size: 13px;
  line-height: 1.55;
  color: var(--j4-slate);
}

/* ----------------------------------------------------------- INTENT SELECTOR */

.j4-intent-grid {
  display: grid;
  gap: 12px;
  margin: 22px 0 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.j4-intent-grid--1 { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 640px) {
  .j4-intent-grid { grid-template-columns: minmax(0, 1fr); }
}

.j4-intent-option {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-height: 92px;
  padding: 18px 20px;
  text-align: left;
  background: #fff;
  border: 1px solid rgba(48, 63, 89, .28);
  border-left: 3px solid rgba(48, 63, 89, .28);
  border-radius: var(--j4-radius);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.j4-intent-option:hover {
  border-color: var(--j4-slate);
  border-left-color: var(--j4-gold);
  background: #fff;
}
.j4-intent-label {
  font-family: var(--j4-ui);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--j4-navy);
}
.j4-intent-help {
  font-family: var(--j4-ui);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--j4-slate);
}
.j4-intent-alt {
  margin: 14px 0 0;
  font-family: var(--j4-ui);
  font-size: 14px;
  color: var(--j4-slate);
}

/* -------------------------------------------------------------------- FORMS */

.j4-form { margin-top: 20px; }

.j4-grid {
  display: grid;
  gap: 14px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.j4-grid--stack { grid-template-columns: minmax(0, 1fr); margin-top: 14px; }
@media (max-width: 640px) { .j4-grid { grid-template-columns: minmax(0, 1fr); } }

.j4-field { display: flex; flex-direction: column; gap: 6px; }
.j4-field--wide { grid-column: 1 / -1; }

.j4-label {
  font-family: var(--j4-ui);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--j4-navy);
}
.j4-optional { font-weight: 400; color: var(--j4-slate); }

.j4-input {
  width: 100%;
  min-height: var(--j4-tap);
  padding: 11px 13px;
  font-family: var(--j4-ui);
  font-size: 16px;           /* 16px stops iOS zoom-on-focus */
  line-height: 1.4;
  color: var(--j4-navy);
  background: #fff;
  border: 1px solid rgba(48, 63, 89, .38);
  border-radius: var(--j4-radius);
  -webkit-appearance: none;
  appearance: none;
}
.j4-input::placeholder { color: #5C667B; }   /* 4.9:1 on white, WCAG 1.4.3 */
.j4-input:hover { border-color: var(--j4-slate); }
.j4-textarea { min-height: 108px; resize: vertical; }
.j4-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23303F59' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.j4-fieldset { border: 0; margin: 0; padding: 0; }
.j4-fieldset > .j4-label { display: block; margin-bottom: 10px; padding: 0; }

.j4-checkgrid {
  display: grid;
  gap: 8px 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 520px) { .j4-checkgrid { grid-template-columns: minmax(0, 1fr); } }

.j4-check { display: flex; align-items: center; gap: 9px; min-height: 34px; }
.j4-checkbox { width: 18px; height: 18px; accent-color: var(--j4-navy); flex: 0 0 auto; }
.j4-checklabel {
  font-family: var(--j4-ui);
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--j4-navy);
  cursor: pointer;
}

.j4-renewal-modes { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

/* The radio is visually hidden but stays in the accessibility tree and stays
   keyboard focusable. pointer-events:none is load-bearing: without it the
   absolutely positioned inputs stack on each other and swallow clicks aimed at
   a neighbouring pill. Clicking the label activates the radio natively. */
.j4-radio {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}
.j4-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  font-family: var(--j4-ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--j4-navy);
  background: #fff;
  border: 1px solid rgba(48, 63, 89, .38);
  border-radius: var(--j4-radius);
  cursor: pointer;
}
.j4-radio:checked + .j4-pill {
  background: var(--j4-navy);
  border-color: var(--j4-navy);
  color: var(--j4-white);
}
.j4-renewal-input[hidden] { display: none; }

.j4-hint {
  margin: 0;
  font-family: var(--j4-ui);
  font-size: 12.5px;
  color: var(--j4-slate);
}

/* Not display:none. A role="alert" node that is display:none at the moment
   its text changes is frequently never announced. Collapse it visually but
   keep it in the accessibility tree and focusable. */
.j4-errors:empty { visibility: hidden; height: 0; padding: 0; margin: 0; border: 0; }
.j4-errors:focus { outline: 2px solid var(--j4-gold); outline-offset: 2px; }
.j4-errors a { color: inherit; }
.j4-errors {
  margin: 14px 0 0;
  padding: 11px 13px;
  font-family: var(--j4-ui);
  font-size: 14px;
  line-height: 1.5;
  color: #6E1414;
  background: #FBEEEE;
  border-left: 3px solid #6E1414;
}

.j4-form .j4-btn--primary { margin-top: 20px; }

/* ------------------------------------------------------------ SUCCESS STATE */

.j4-success-offer {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(48, 63, 89, .2);
}
.j4-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.j4-success .j4-linkbtn { margin-top: 16px; }

/* -------------------------------------------------------------- PRINT / RM */

@media print { .j4-sticky, .j4-modal-overlay { display: none !important; } }
