/* ===== Dynamic-site additions: animations, banner, portal link ===== */
:root { --jfi-teal: #042626; --jfi-accent: #f2a541; }

.site-header { transition: box-shadow .3s ease, background-color .3s ease, padding .3s ease; }
.site-header.jfi-scrolled { box-shadow: 0 6px 24px rgba(4, 38, 38, .14); }

.jfi-announce {
  background: var(--jfi-accent); color: #1c1c1c; text-align: center;
  font: 600 15px/1.4 Fredoka, system-ui, sans-serif; padding: 9px 16px;
  animation: jfi-drop .5s ease both;
}
@keyframes jfi-drop { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }

.nav-actions .jfi-portal-link {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none;
  padding: 8px 14px; border-radius: 999px; border: 2px solid currentColor; white-space: nowrap;
  transition: transform .2s ease, background-color .2s ease;
}
.nav-actions .jfi-portal-link:hover { transform: translateY(-2px); }
@media (max-width: 900px) { .nav-actions .jfi-portal-link { padding: 8px 12px; font-size: 13px; } }

@media (prefers-reduced-motion: no-preference) {
  .jfi-reveal { opacity: 0; transform: translateY(28px); }
  .jfi-reveal.jfi-in {
    opacity: 1; transform: none;
    transition: opacity .7s ease var(--jfi-delay, 0ms), transform .7s cubic-bezier(.2, .7, .2, 1) var(--jfi-delay, 0ms);
  }
  .jfi-hero-in .hero-copy > * { animation: jfi-rise .8s cubic-bezier(.2, .7, .2, 1) both; }
  .jfi-hero-in .hero-copy > *:nth-child(2) { animation-delay: .08s; }
  .jfi-hero-in .hero-copy > *:nth-child(3) { animation-delay: .16s; }
  .jfi-hero-in .hero-copy > *:nth-child(4) { animation-delay: .24s; }
  .jfi-hero-in .hero-copy > *:nth-child(5) { animation-delay: .32s; }
  @keyframes jfi-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

  .insurance-card, .agent-card, .steps > div { transition: transform .25s ease, box-shadow .25s ease; }
  .insurance-card:hover, .agent-card:hover, .steps > div:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(4, 38, 38, .16); }
  .insurance-card .icon img { transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
  .insurance-card:hover .icon img { transform: scale(1.08) rotate(-3deg); }
  .btn { transition: transform .2s ease, box-shadow .2s ease; }
  .btn:hover { transform: translateY(-2px); }

}

/* ===== 3D: B. Spinning coverage carousel (hero) ===== */
@media (min-width: 980px) {
  .hero .hero-grid.jfi-has-ring { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr) !important; gap: 40px; }
}
.jfi-ring-stage {
  position: relative; display: grid; place-items: center; min-height: 340px; perspective: 1100px;
  overflow: hidden; border-radius: 28px; touch-action: pan-y;
  background: radial-gradient(ellipse at 50% 72%, #e3f2ef, rgba(255, 255, 255, 0) 68%);
}
.jfi-ring { position: relative; width: 128px; height: 158px; transform-style: preserve-3d; scale: var(--jfi-scale, 1);
  animation: jfi-spin 30s linear infinite; }
.jfi-ring-stage.paused .jfi-ring, .jfi-ring-stage.still .jfi-ring { animation-play-state: paused; }
.jfi-ring-face {
  position: absolute; inset: 0; display: grid; justify-items: center; align-content: center; gap: 6px; padding: 10px 8px;
  background: #fff; color: #042626; border: 1px solid rgba(4, 38, 38, .16); border-radius: 20px; cursor: pointer;
  font: 600 14px/1.2 'Fredoka', system-ui, sans-serif; text-align: center;
  box-shadow: 0 14px 28px rgba(4, 38, 38, .13); backface-visibility: hidden; transition: box-shadow .2s, border-color .2s;
}
.jfi-ring-face img { width: 72px; height: 72px; object-fit: contain; }
.jfi-ring-face:hover { border-color: #042626; box-shadow: 0 18px 36px rgba(4, 38, 38, .2); }
.jfi-ring-face:focus-visible { outline: 3px solid #239c91; outline-offset: 3px; }
.jfi-ring-ground { position: absolute; bottom: 58px; left: 20%; right: 20%; height: 30px; border-radius: 50%;
  background: radial-gradient(rgba(4, 38, 38, .2), transparent 70%); }
.jfi-ring-hint { position: absolute; bottom: 14px; left: 0; right: 0; margin: 0; text-align: center; font-size: 14px; color: #042626; opacity: .7; }
@keyframes jfi-spin { from { transform: rotateY(0deg); } to { transform: rotateY(-360deg); } }
@media (max-width: 979px) { .jfi-ring-stage { min-height: 290px; } }

/* ===== 3D: C. Flipping agent cards ===== */
#agents .agent-card.jfi-flip { display: block; border: 0; border-radius: 22px; overflow: visible; background: none; perspective: 1400px; }
.jfi-flip-inner { display: grid; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.3, 1.25, .5, 1); }
.jfi-flip.flipped .jfi-flip-inner { transform: rotateY(180deg); }
.jfi-flip-face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 2px solid #042626;
  border-radius: 22px; overflow: hidden; background: #fff; box-shadow: 0 16px 36px rgba(4, 38, 38, .12); }
.jfi-flip-front { position: relative; display: block; width: 100%; min-height: 440px; padding: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; }
#agents .jfi-flip-front .agent-photo { position: absolute; inset: 0; border: 0; }
#agents .jfi-flip-front .agent-photo img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; object-position: 50% 20%; display: block; }
.jfi-flip-cap { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 2px; padding: 46px 20px 18px; color: #fff;
  background: linear-gradient(to top, rgba(4, 38, 38, .92), rgba(4, 38, 38, .55) 60%, rgba(4, 38, 38, 0)); }
.jfi-flip-cap b { font-size: 24px; font-weight: 600; }
.jfi-flip-cap small { font-size: 15px; opacity: .9; }
.jfi-flip-cap em { font-style: normal; font-size: 14px; margin-top: 6px; opacity: .85; }
.jfi-flip-front:focus-visible { outline: 3px solid #239c91; outline-offset: 4px; }
.jfi-flip-back { transform: rotateY(180deg); display: flex; flex-direction: column; }
.jfi-flip-back .agent-body { flex: 1; }
.jfi-flip-return { align-self: flex-end; margin: 0 18px 16px; background: none; border: 1px solid rgba(4, 38, 38, .3); border-radius: 999px;
  padding: 6px 14px; font: 600 13px 'Fredoka', system-ui, sans-serif; color: #042626; cursor: pointer; }
.jfi-flip-return:focus-visible { outline: 3px solid #239c91; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .jfi-flip-inner { transition: none; } }

/* ===== Rater: one question at a time ===== */
#jfr-rater.jfw-on .jfr-tabs, #jfr-rater.jfw-on .jfr-one { display: none !important; }
.jfw { max-width: 640px; margin: 18px auto 8px; background: linear-gradient(180deg, #f3faf8 0%, #ffffff 70%); border: 0; border-radius: 28px; padding: 24px;
  box-shadow: 0 1px 2px rgba(4, 38, 38, .06), 0 18px 48px rgba(4, 38, 38, .10); color: #042626; font-family: 'Fredoka', system-ui, sans-serif; text-align: left; }
.jfw-prog { height: 8px; background: #e8f4f2; border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.jfw-prog i { display: block; height: 100%; background: #27c864; border-radius: inherit; transition: width .35s ease; }
.jfw-count { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .7; margin-bottom: 6px; }
.jfw-q { font-size: clamp(20px, 2.6vw, 24px); font-weight: 600; margin: 0 0 14px; line-height: 1.25; text-wrap: balance; }
.jfw-q-sm { font-size: 19px; margin-top: 16px; }
.jfw-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.jfw-tiles.jfw-two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 340px; }
.jfw-tile { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 56px; padding: 12px 10px; border: 1.5px solid rgba(4, 38, 38, .2);
  border-radius: 16px; background: #fff; color: #042626; cursor: pointer; font: 600 15px/1.25 'Fredoka', system-ui, sans-serif; text-align: center;
  transition: border-color .15s, transform .15s, background .15s; }
.jfw-tiles-icons .jfw-tile { min-height: 104px; }
.jfw-tile img { width: 48px; height: 48px; object-fit: contain; }
.jfw-tile:hover { border-color: #042626; transform: translateY(-2px); }
.jfw-tile.sel { background: #042626; color: #fff; border-color: #042626; }
.jfw-tile:focus-visible, .jfw-back:focus-visible, .jfw-next:focus-visible, .jfw-again:focus-visible, .jfw-select:focus-visible { outline: 3px solid #239c91; outline-offset: 2px; }
.jfw-select { width: 100%; font: 500 17px 'Fredoka', system-ui, sans-serif; color: #042626; padding: 13px 12px; border: 2px solid #042626; border-radius: 14px; background: #fff; }
.jfw-note { margin: 14px 0 0; font-size: 14px; line-height: 1.45; background: #f3f8f7; border-radius: 12px; padding: 10px 12px; opacity: .9; }
.jfw-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.jfw-back, .jfw-again { background: none; border: 1.5px solid rgba(4, 38, 38, .3); border-radius: 999px; padding: 9px 18px; cursor: pointer;
  font: 600 14px 'Fredoka', system-ui, sans-serif; color: #042626; text-transform: uppercase; letter-spacing: .04em; }
.jfw-next { margin-left: auto; background: #27c864; color: #042626; border: 0; border-radius: 14px; padding: 12px 24px; cursor: pointer;
  font: 600 15px 'Fredoka', system-ui, sans-serif; text-transform: uppercase; letter-spacing: .04em; box-shadow: 0 4px 0 #1a8f46; }
.jfw-next:active { transform: translateY(4px); box-shadow: none; }
.jfw-est { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; background: #e8f4f2; border-radius: 18px; padding: 14px 16px; }
.jfw-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.jfw-amt { font-size: 34px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.jfw-est p { margin: 2px 0 0; font-size: 14px; opacity: .8; }
.jfw-split { display: flex; gap: 18px; }
.jfw-split div { display: grid; }
.jfw-split b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.jfw-split span { font-size: 12px; opacity: .75; }
.jfw-slot-form .jfr-send, .jfw-slot-act .jfr-act { margin: 0; }
.jfw-slot-act { margin-top: 12px; }
.jfw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.jfw-fade { animation: jfw-in .3s ease both; }
@keyframes jfw-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 520px) { .jfw { padding: 16px; border-radius: 20px; } .jfw-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .jfw-fade { animation: none; } .jfw-prog i { transition: none; } }

/* Borderless look inside the rater (softens the borrowed contact form + buttons too) */
#jfr-rater .jfw .jfw-tile { border-color: transparent; background: #fff; box-shadow: 0 1px 2px rgba(4, 38, 38, .08), 0 4px 12px rgba(4, 38, 38, .06); }
#jfr-rater .jfw .jfw-tile:hover { border-color: transparent; box-shadow: 0 2px 4px rgba(4, 38, 38, .1), 0 10px 22px rgba(4, 38, 38, .12); }
#jfr-rater .jfw .jfw-tile.sel { background: #042626; color: #fff; }
#jfr-rater .jfw .jfw-select { border: 1.5px solid rgba(4, 38, 38, .14); box-shadow: 0 2px 8px rgba(4, 38, 38, .05); }
#jfr-rater .jfw .jfw-note { background: rgba(255, 255, 255, .8); border: 0 !important; }
#jfr-rater .jfw .jfw-est { background: #fff; box-shadow: 0 1px 2px rgba(4, 38, 38, .06), 0 6px 16px rgba(4, 38, 38, .06); }
#jfr-rater .jfw .jfr-sf input { border: 1.5px solid rgba(4, 38, 38, .14); background: #fff; box-shadow: 0 1px 2px rgba(4, 38, 38, .04); transition: border-color .15s, box-shadow .15s; }
#jfr-rater .jfw .jfr-sf input:focus { border-color: #239c91; box-shadow: 0 0 0 4px rgba(35, 156, 145, .15); outline: none; }
#jfr-rater .jfw .jfr-sendbtn { border: 0 !important; background: #27c864; color: #042626; box-shadow: 0 5px 0 #1a8f46; }
#jfr-rater .jfw .jfr-sendbtn:active { transform: translateY(4px); box-shadow: none; }
#jfr-rater .jfw .jfr-call { border: 1.5px solid rgba(4, 38, 38, .16) !important; background: #fff !important; }
#jfr-rater .jfw .jfr-warn { border: 0 !important; background: #fff6e5 !important; }
#jfr-rater .jfw .jfw-back, #jfr-rater .jfw .jfw-again { border-color: rgba(4, 38, 38, .16); background: #fff; }

/* ===== Unified larger boxes + icons (rater, coverage cards, carousel) — icon 104px desktop / 88px phone ===== */
:root { --jfi-icon: 104px; }
@media (max-width: 600px) { :root { --jfi-icon: 88px; } }
#jfr-rater .jfw { max-width: 820px; padding: 28px; }
#jfr-rater .jfw .jfw-tiles { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
#jfr-rater .jfw .jfw-tiles-icons .jfw-tile { min-height: 190px; gap: 10px; padding: 18px 12px; border-radius: 20px; }
#jfr-rater .jfw .jfw-tile { min-height: 74px; font-size: 17px; border-radius: 18px; }
#jfr-rater .jfw .jfw-tile img { width: var(--jfi-icon); height: var(--jfi-icon); filter: drop-shadow(0 10px 14px rgba(4, 38, 38, .18)); }
#jfr-rater .jfw .jfw-q { font-size: clamp(22px, 2.8vw, 28px); }
@media (max-width: 520px) {
  #jfr-rater .jfw { padding: 18px; }
  #jfr-rater .jfw .jfw-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #jfr-rater .jfw .jfw-tiles-icons .jfw-tile { min-height: 160px; }
}
.insurance-card .icon, .insurance-card .icon img { width: var(--jfi-icon) !important; height: var(--jfi-icon) !important; }
.jfi-ring { width: 160px; height: 200px; }
.jfi-ring-face { font-size: 16px; border-radius: 22px; }
.jfi-ring-face img { width: var(--jfi-icon); height: var(--jfi-icon); }
.jfi-ring-stage { min-height: 400px; }
@media (max-width: 979px) { .jfi-ring-stage { min-height: 340px; } }

/* ===== Header: logo pinned top-left, Client Portal pinned top-right ===== */
.site-header .container.nav { width: 100%; max-width: none; margin: 0; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.site-header .nav-actions { margin-left: auto; }
.site-header .nav-actions .jfi-portal-link { order: 99; }

/* ===== Header: one row, every button the same pill + color-fill (Start a Quote keeps its green) ===== */
.site-header .container.nav { display: flex !important; flex-wrap: nowrap !important; align-items: center; gap: 12px; min-height: 76px; }
.site-header .container.nav > .brand { order: 1; flex-shrink: 0; }
.site-header .container.nav > nav { order: 2; display: flex !important; flex: 1 1 auto; min-width: 0; justify-content: center; flex-wrap: nowrap !important; gap: 6px !important;
  overflow-x: auto; scrollbar-width: none; padding: 4px 2px; margin: 0; }
.site-header .container.nav > nav::-webkit-scrollbar { display: none; }
.site-header .container.nav > .nav-actions { order: 3; margin-left: 0 !important; flex-shrink: 0; gap: 6px !important; }
.site-header .nav-actions .jfi-portal-link { order: 99; }

/* shared pill */
.site-header .container.nav > nav a,
.site-header .nav-actions .lang,
.site-header .nav-actions .jfi-portal-link,
.site-header .nav-actions a.btn-primary {
  position: relative; z-index: 0; overflow: hidden; isolation: isolate;
  display: inline-flex !important; align-items: center; justify-content: center; white-space: nowrap;
  min-height: 42px; padding: 0 14px !important; border-radius: 999px !important;
  font: 600 13px/1 'Fredoka', system-ui, sans-serif !important; letter-spacing: .05em !important; text-transform: uppercase; text-decoration: none;
  transition: color .25s ease, transform .15s ease, border-color .25s ease;
}
.site-header .container.nav > nav a,
.site-header .nav-actions .lang,
.site-header .nav-actions .jfi-portal-link {
  border: 1.5px solid #042626 !important; background: #fff !important; color: #042626 !important; box-shadow: none !important;
}
/* Option D: teal fills in from the left */
.site-header .container.nav > nav a::before,
.site-header .nav-actions .lang::before,
.site-header .nav-actions .jfi-portal-link::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: #042626; transform: scaleX(0); transform-origin: left;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.site-header .container.nav > nav a:hover, .site-header .container.nav > nav a:focus-visible, .site-header .container.nav > nav a[aria-current="true"],
.site-header .nav-actions .lang:hover, .site-header .nav-actions .lang:focus-visible,
.site-header .nav-actions .jfi-portal-link:hover, .site-header .nav-actions .jfi-portal-link:focus-visible { color: #fff !important; }
.site-header .container.nav > nav a:hover::before, .site-header .container.nav > nav a:focus-visible::before, .site-header .container.nav > nav a[aria-current="true"]::before,
.site-header .nav-actions .lang:hover::before, .site-header .nav-actions .lang:focus-visible::before,
.site-header .nav-actions .jfi-portal-link:hover::before, .site-header .nav-actions .jfi-portal-link:focus-visible::before { transform: scaleX(1); }
.site-header .container.nav > nav a:active, .site-header .nav-actions a:active { transform: scale(.97); }
.site-header .container.nav > nav a:focus-visible, .site-header .nav-actions a:focus-visible { outline: 3px solid #239c91 !important; outline-offset: 3px; }
/* Start a Quote: same size and shape, keeps its green + glow animation */
.site-header .nav-actions a.btn-primary { border: 0 !important; }

/* tighter on medium screens so everything still fits on one row */
@media (max-width: 1380px) {
  .site-header .container.nav > nav a, .site-header .nav-actions .lang, .site-header .nav-actions .jfi-portal-link, .site-header .nav-actions a.btn-primary { padding: 0 10px !important; font-size: 12px !important; min-height: 38px; }
  .site-header .logo-window { width: 160px !important; }
}
/* tablets & phones: menu drops to its own scrollable row under the logo */
@media (max-width: 1100px) {
  .site-header .container.nav { flex-wrap: wrap !important; row-gap: 8px; padding-block: 8px; }
  .site-header .container.nav > .nav-actions { order: 2; margin-left: auto !important; }
  .site-header .container.nav > nav { order: 3; flex-basis: 100%; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header .container.nav > nav a::before, .site-header .nav-actions a::before { transition: none; }
}
@media (max-width: 600px) {
  .site-header .nav-actions a.btn-primary { display: none !important; }
  .site-header .container.nav > .brand .logo-window { width: 130px !important; }
  .site-header .container.nav > nav a, .site-header .nav-actions .lang, .site-header .nav-actions .jfi-portal-link { padding: 0 11px !important; font-size: 12px !important; min-height: 38px; }
}
