/* ============================================================
   FluteLoans — element styles

   Scope rule: everything here is either
     (a) scoped to one of the two custom elements (.fl-estimator, .fl-float), or
     (b) a named utility applied via a WPBakery "Extra class name" field,
         listed in the UTILITIES section and documented in AGENTS.md.

   If you are about to add a rule that styles a section, a card, a heading or
   a button, stop — Salient's Theme Options and WPBakery Design Options
   already do that, and doing it here makes the page uneditable for the client.
   ============================================================ */

/* ============================================================
   FLOATING CARD  (fl_float_card)
   ============================================================ */
/* Establish the containing block. A floating card is dropped in as a sibling of
   the image element inside a column's .wpb_wrapper, and Salient does not make
   that wrapper position:relative. Scoped with :has() so it only applies to
   wrappers that actually contain a floating card. */
.wpb_wrapper:has(> .fl-float) {
  position: relative;
}

.fl-float {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--fl-surface-card);
  border: 1px solid var(--fl-border-hairline);
  border-radius: var(--fl-radius-lg);
  box-shadow: var(--fl-shadow-lg);
  padding: 16px 18px;
  max-width: 260px;
}

.fl-float--pill {
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--fl-radius-pill);
  box-shadow: var(--fl-shadow-md);
  background: var(--fl-success-soft);
  border-color: transparent;
  max-width: none;
}

.fl-float__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fl-green-500);
  flex-shrink: 0;
}

.fl-float--pill .fl-float__title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--fl-green-700);
}

.fl-float__ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--fl-brand-soft);
  color: var(--fl-brand-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fl-float__body {
  display: block;
}

.fl-float__title {
  display: block;
  font-family: var(--fl-font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--fl-text-strong);
}

.fl-float__sub {
  display: block;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--fl-text-muted);
  margin-top: 2px;
}

/* Corners. Offsets pull the card slightly outside the image, as designed. */
.fl-float--bottom-left  { left: -18px;  bottom: -22px; }
.fl-float--bottom-right { right: -18px; bottom: -22px; }
.fl-float--top-left     { left: -18px;  top: 22px; }
.fl-float--top-right    { right: -14px; top: 22px; }

@media (max-width: 999px) {
  .fl-float--m-stack {
    position: static;
    max-width: none;
    margin-top: 14px;
    box-shadow: var(--fl-shadow-md);
  }
  .fl-float--m-stack.fl-float--pill {
    display: inline-flex;
  }
  .fl-float--m-hide {
    display: none;
  }
}

/* ============================================================
   RATE ESTIMATOR  (fl_rate_estimator)
   ============================================================ */
.fl-estimator {
  --fl-range-fill: 25%;
  background: var(--fl-surface-card);
  border: 1px solid var(--fl-border-hairline);
  border-radius: var(--fl-radius-lg);
  box-shadow: var(--fl-shadow-md);
  padding: 34px;
}

.fl-estimator__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.fl-estimator__title {
  font-family: var(--fl-font-display);
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1.2;
  color: var(--fl-text-strong);
}

.fl-estimator__meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--fl-text-muted);
  white-space: nowrap;
}

.fl-estimator__ico {
  flex-shrink: 0;
}

.fl-estimator__ico--success {
  color: var(--fl-success);
}

/* ---- Slider ---- */
.fl-estimator__slider-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.fl-estimator__label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--fl-text-strong);
}

.fl-estimator__amount {
  font-family: var(--fl-font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fl-text-brand);
  font-variant-numeric: tabular-nums;
}

.fl-estimator__range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--fl-radius-pill);
  background: linear-gradient(
    to right,
    var(--fl-violet-500) 0 var(--fl-range-fill),
    var(--fl-plum-100) var(--fl-range-fill) 100%
  );
  outline: none;
  margin: 0;
  cursor: pointer;
}

.fl-estimator__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--fl-violet-500);
  box-shadow: var(--fl-shadow-md);
  cursor: grab;
}

.fl-estimator__range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--fl-violet-500);
  box-shadow: var(--fl-shadow-md);
  cursor: grab;
}

.fl-estimator__range:focus-visible {
  box-shadow: 0 0 0 4px var(--fl-brand-soft);
}

.fl-estimator__bounds {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--fl-font-mono);
  font-size: 0.75rem;
  color: var(--fl-text-muted);
}

/* ---- Live readout ---- */
.fl-estimator__readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 26px;
  padding: 18px 20px;
  border-radius: var(--fl-radius-md);
  background: var(--fl-brand-tint);
  border: 1px solid var(--fl-brand-soft);
}

.fl-estimator__readout-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: var(--fl-ls-caps);
  font-weight: 700;
  color: var(--fl-text-muted);
  white-space: nowrap;
}

.fl-estimator__readout-value {
  font-family: var(--fl-font-mono);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--fl-text-strong);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.fl-estimator__readout-side {
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
}

.fl-estimator__readout-apr {
  font-family: var(--fl-font-mono);
  font-size: 0.875rem;
  color: var(--fl-text-body);
}

.fl-estimator__readout-term {
  font-size: 0.75rem;
  color: var(--fl-text-muted);
  margin-top: 3px;
}

/* ---- Trust row + footnote ---- */
.fl-estimator__trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.fl-estimator__trust span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  color: var(--fl-text-muted);
}

.fl-estimator__note {
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--fl-text-subtle);
  margin: 16px 0 0;
}

@media (max-width: 480px) {
  .fl-estimator {
    padding: 24px 20px;
  }
  .fl-estimator__readout {
    flex-direction: column;
    align-items: flex-start;
  }
  .fl-estimator__readout-side {
    text-align: left;
  }
}

/* ============================================================
   UTILITIES
   Applied through a WPBakery "Extra class name" field. Each one exists
   because Salient's Design Options have no equivalent setting.
   ============================================================ */

/* Knock the full-colour logo out to white for the dark footer. Applied via the
   footer logo element's Extra class name. Salient has no "invert image" option
   — the alternative is maintaining a second white logo asset. */
.fl-footer-logo img {
  filter: brightness(0) invert(1);
}

/* Anchor landing offset, so the sticky header never covers a section
   heading when a nav link jumps to it. */
.fl-anchor {
  scroll-margin-top: 100px;
}

/* Vertically centre a column against a taller sibling. Applied to the "Why
   choose us" image column, whose value-cards neighbour is much taller. The
   row's content_placement="middle" should handle this, but Salient does not
   always stretch the flex row, so this pins the column itself. */
.fl-valign-mid {
  align-self: center;
}

/* Tabular figures for the big stat numbers, so the count-up animation
   does not make the row jitter. */
.fl-tnum,
.fl-tnum * {
  font-variant-numeric: tabular-nums;
}

/* Two-column field layout inside a Contact Form 7 template.
   CF7 emits a flat list of paragraphs and has no layout controls of its own. */
.fl-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.fl-form-grid > p,
.fl-field {
  margin-bottom: 14px;
}

.fl-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--fl-text-strong);
}

/* Inline email + button, used by the footer newsletter form. */
.fl-form-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}

.fl-form-inline .wpcf7-form-control-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 560px) {
  .fl-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   GLOBAL EXCEPTIONS
   Rules that are not element-scoped, each here because Salient exposes
   no Theme Option for them. Keep this list short and justified.
   ============================================================ */

/* Input corner radius. Theme Options cover input background, border colour,
   border width and padding, but not radius — the material skin hardcodes 4px
   and the design calls for 14px. */
body .container-wrap input[type="text"],
body .container-wrap input[type="email"],
body .container-wrap input[type="tel"],
body .container-wrap input[type="number"],
body .container-wrap input[type="password"],
body .container-wrap select,
body .container-wrap textarea {
  border-radius: var(--fl-radius-md);
}

/* Header CTA buttons — keep them legible in every header state.
   Salient recolours nav text per the section under the header (transparent,
   scrolled/opaque, and .dark-slide over dark bands). With no Theme Option to
   pin the CTA colours, the solid "Apply" button's label could turn the same
   violet as its fill (reading as a solid purple block) once scrolled, and the
   bordered "Login" button's outline flips to black/dark. Force both:
     - Apply  (button_solid_color): accent fill, white label, always.
     - Login  (button_bordered):    accent outline + accent label, always.
   Salient sets these with !important, so these overrides must too. */
#header-outer #top nav > ul > li[class*="button_solid_color"] > a,
#header-outer.transparent #top nav > ul > li[class*="button_solid_color"] > a,
#header-outer.transparent.dark-slide #top nav > ul > li[class*="button_solid_color"] > a {
  color: #fff !important;
}
#header-outer #top nav > ul > li[class*="button_solid_color"] > a:before,
#header-outer.transparent #top nav > ul > li[class*="button_solid_color"] > a:before,
#header-outer.transparent.dark-slide #top nav > ul > li[class*="button_solid_color"] > a:before {
  background-color: var(--fl-brand) !important;
}

#header-outer #top nav > ul > li[class*="button_bordered"] > a,
#header-outer.transparent #top nav > ul > li[class*="button_bordered"] > a,
#header-outer.transparent.dark-slide #top nav > ul > li[class*="button_bordered"] > a {
  color: var(--fl-brand-strong) !important;
}
#header-outer #top nav > ul > li[class*="button_bordered"] > a:before,
#header-outer.transparent #top nav > ul > li[class*="button_bordered"] > a:before,
#header-outer.transparent.dark-slide #top nav > ul > li[class*="button_bordered"] > a:before {
  border-color: var(--fl-brand) !important;
}

