/* ForFlippers homepage overhaul
   Inspired by FSBO structure; scoped to .ff-* sections */

@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap');

:root {
  --ff-ink: #12161c;
  --ff-ink-soft: #2a313c;
  --ff-paper: #f2f4f1;
  --ff-paper-deep: #e4e9e2;
  --ff-accent: #e85d04;
  --ff-accent-deep: #c44d03;
  --ff-forest: #1b5c4b;
  --ff-muted: #5c6570;
  --ff-white: #ffffff;
  --ff-line: rgba(18, 22, 28, 0.1);
  --ff-display: 'Syne', sans-serif;
  --ff-body: 'Figtree', sans-serif;
  --ff-radius: 14px;
  --ff-shadow: 0 18px 50px rgba(18, 22, 28, 0.12);
  --ff-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ff-section-pad: clamp(3.5rem, 7vw, 6rem);
  --ff-gutter: clamp(1.25rem, 4vw, 3.5rem);
}

/* ---- Shared ---- */
.ff-hero,
.ff-markets,
.ff-deals,
.ff-steps,
.ff-types,
.ff-quotes,
.ff-cta {
  font-family: var(--ff-body);
  color: var(--ff-ink);
}

.ff-section-head {
  max-width: 40rem;
  margin: 0 auto clamp(1.75rem, 3vw, 2.5rem);
  padding: 0 var(--ff-gutter);
  text-align: left;
}

.ff-section-head--row {
  max-width: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.ff-section-head__aside {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-right: var(--ff-gutter);
  margin-left: auto;
}

.ff-section-title {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.2vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.55rem;
  color: var(--ff-ink);
}

.ff-section-lead {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ff-muted);
  max-width: 34rem;
}

.ff-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.1rem;
  padding: 0.75rem 1.45rem;
  border-radius: 999px;
  font-family: var(--ff-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none !important;
  border: 1.5px solid transparent;
  transition: transform 0.35s var(--ff-ease), background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.ff-btn:hover {
  transform: translateY(-2px);
}

.ff-btn--primary {
  background: var(--ff-accent);
  color: var(--ff-white) !important;
}

.ff-btn--primary:hover {
  background: var(--ff-accent-deep);
  color: var(--ff-white) !important;
}

.ff-btn--ghost {
  background: transparent;
  color: var(--ff-white) !important;
  border-color: rgba(255, 255, 255, 0.55);
}

.ff-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ff-white) !important;
}

.ff-btn--ghost-dark {
  background: transparent;
  color: var(--ff-ink) !important;
  border-color: rgba(18, 22, 28, 0.25);
}

.ff-btn--ghost-dark:hover {
  background: rgba(18, 22, 28, 0.06);
}

.ff-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ff-forest) !important;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
}

.ff-link:hover {
  color: var(--ff-accent) !important;
}

.ff-scroll-nav {
  display: flex;
  gap: 0.5rem;
}

.ff-scroll-nav__btn {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  border: 1px solid var(--ff-line);
  background: var(--ff-white);
  color: var(--ff-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ff-scroll-nav__btn:hover {
  background: var(--ff-ink);
  border-color: var(--ff-ink);
  color: var(--ff-white);
}

.ff-empty {
  padding: 2rem var(--ff-gutter);
  color: var(--ff-muted);
}

/* Reveal motion */
[data-ff-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ff-ease), transform 0.8s var(--ff-ease);
}

[data-ff-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---- Hero ---- */
.ff-hero {
  position: relative;
  min-height: min(92vh, 860px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: var(--ff-white);
  isolation: isolate;
}

.ff-hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-color: var(--ff-ink);
  background-image: var(--ff-hero-image, linear-gradient(135deg, #1b5c4b 0%, #12161c 55%, #2a1810 100%));
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
  animation: ff-hero- ken 18s var(--ff-ease) both;
}

.ff-hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(18, 22, 28, 0.28) 0%, rgba(18, 22, 28, 0.55) 42%, rgba(18, 22, 28, 0.88) 100%),
    radial-gradient(ellipse 80% 55% at 20% 80%, rgba(232, 93, 4, 0.22), transparent 60%);
}

.ff-hero__inner {
  width: 100%;
  max-width: 920px;
  padding: clamp(6.5rem, 12vh, 9rem) var(--ff-gutter) clamp(2.5rem, 5vh, 3.5rem);
}

.ff-hero__brand {
  margin: 0 0 0.85rem;
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  letter-spacing: -0.03em;
  color: var(--ff-white);
  opacity: 0;
  animation: ff-rise 0.9s var(--ff-ease) 0.15s forwards;
}

.ff-hero__title {
  margin: 0 0 1rem;
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: clamp(2.35rem, 6vw, 4.1rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--ff-white);
  max-width: 14ch;
  opacity: 0;
  animation: ff-rise 0.9s var(--ff-ease) 0.28s forwards;
}

.ff-hero__lead {
  margin: 0 0 1.6rem;
  max-width: 34rem;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  opacity: 0;
  animation: ff-rise 0.9s var(--ff-ease) 0.4s forwards;
}

.ff-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  opacity: 0;
  animation: ff-rise 0.9s var(--ff-ease) 0.52s forwards;
}

.ff-hero__search {
  width: 100%;
  max-width: 760px;
  margin: 0 !important;
  opacity: 0;
  animation: ff-rise 0.9s var(--ff-ease) 0.64s forwards;
}

.ff-hero__search-box {
  display: flex !important;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
  margin: 0 !important;
  padding: 0.55rem;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  box-shadow: var(--ff-shadow);
  width: 100%;
}

.ff-hero .form_field {
  flex: 1 1 140px;
  margin: 0 !important;
  float: none !important;
  width: auto !important;
  max-width: none !important;
}

.ff-hero .form_field label,
.ff-hero .form_field .form-label {
  display: none;
}

.ff-hero .form_field .form-control,
.ff-hero .form_field .bootstrap-select .dropdown-toggle,
.ff-hero .form_field input,
.ff-hero .form_field select {
  height: 3rem !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-family: var(--ff-body);
  font-size: 0.95rem;
  color: var(--ff-ink);
  border-radius: 12px !important;
}

.ff-hero .srch-btn {
  flex: 0 0 auto !important;
  margin: 0 !important;
}

.ff-hero .ff-search-submit,
.ff-hero .sw-search-start {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 3rem;
  padding: 0 1.25rem !important;
  border-radius: 12px !important;
  background: var(--ff-ink) !important;
  border-color: var(--ff-ink) !important;
  color: var(--ff-white) !important;
  font-weight: 600;
}

.ff-hero .ff-search-submit:hover,
.ff-hero .sw-search-start:hover {
  background: var(--ff-accent) !important;
  border-color: var(--ff-accent) !important;
}

.ff-hero .search-additional-btn {
  display: none !important;
}

.ff-hero #form-addittional {
  width: 100%;
  padding-top: 0.5rem;
}

/* ---- Markets ---- */
.ff-markets {
  padding: var(--ff-section-pad) 0;
  background: var(--ff-paper);
}

.ff-markets__track,
.ff-deals__track,
.ff-quotes__track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0.25rem var(--ff-gutter) 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ff-markets__track::-webkit-scrollbar,
.ff-deals__track::-webkit-scrollbar,
.ff-quotes__track::-webkit-scrollbar {
  display: none;
}

.ff-market {
  position: relative;
  flex: 0 0 min(78vw, 280px);
  height: 320px;
  border-radius: var(--ff-radius);
  overflow: hidden;
  scroll-snap-align: start;
  text-decoration: none !important;
  color: var(--ff-white) !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  isolation: isolate;
  transition: transform 0.45s var(--ff-ease);
  background: var(--ff-paper-deep);
}

.ff-market::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background-color: #1c2430;
  background-image: var(--ff-market-img, none);
  background-size: cover;
  background-position: center;
  transition: transform 0.7s var(--ff-ease), opacity 0.4s ease;
  opacity: 0;
}

.ff-market.is-bg-loaded::before {
  opacity: 1;
}

.ff-market::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent 35%, rgba(18, 22, 28, 0.88) 100%);
}

.ff-market:hover {
  transform: translateY(-4px);
}

.ff-market:hover::before {
  transform: scale(1.06);
}

.ff-market__name {
  font-family: var(--ff-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.ff-market__meta {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.78);
}

/* ---- Deals ---- */
.ff-deals {
  padding: var(--ff-section-pad) 0;
  background: var(--ff-white);
}

.ff-deal {
  flex: 0 0 min(82vw, 320px);
  scroll-snap-align: start;
  background: var(--ff-paper);
  border-radius: var(--ff-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s var(--ff-ease), box-shadow 0.4s var(--ff-ease);
}

.ff-deal:hover {
  transform: translateY(-4px);
  box-shadow: var(--ff-shadow);
}

.ff-deal__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--ff-paper-deep);
}

.ff-deal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ff-ease);
}

.ff-deal:hover .ff-deal__media img {
  transform: scale(1.05);
}

.ff-deal__purpose {
  position: absolute;
  left: 0.85rem;
  bottom: 0.85rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(18, 22, 28, 0.82);
  color: var(--ff-white);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ff-deal__body {
  padding: 1.1rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.ff-deal__price {
  margin: 0;
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ff-ink);
}

.ff-deal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.ff-deal__title a {
  color: var(--ff-ink) !important;
  text-decoration: none !important;
}

.ff-deal__title a:hover {
  color: var(--ff-accent) !important;
}

.ff-deal__address {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ff-muted);
}

.ff-deal__address i {
  margin-right: 0.15rem;
}

.ff-deal__specs {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0.65rem 0 0;
  border-top: 1px solid var(--ff-line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  font-size: 0.82rem;
  color: var(--ff-ink-soft);
}

.ff-deal--skeleton {
  min-height: 360px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--ff-paper-deep) 0%, #eef1ee 50%, var(--ff-paper-deep) 100%);
  background-size: 200% 100%;
  animation: ff-shimmer 1.2s ease-in-out infinite;
}

.ff-type img.lazy,
.ff-deal__media img.lazy {
  background: var(--ff-paper-deep);
}

@keyframes ff-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ---- Steps ---- */
.ff-steps {
  padding: var(--ff-section-pad) 0;
  background:
    linear-gradient(160deg, #163d34 0%, #1b5c4b 42%, #0f2f28 100%);
  color: var(--ff-white);
}

.ff-steps .ff-section-title,
.ff-steps .ff-section-lead {
  color: var(--ff-white);
}

.ff-steps .ff-section-lead {
  opacity: 0.8;
}

.ff-steps__list {
  list-style: none;
  margin: 0;
  padding: 0 var(--ff-gutter);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  max-width: 1200px;
  margin-inline: auto;
}

.ff-step__num {
  display: block;
  font-family: var(--ff-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #f4a261;
  margin-bottom: 0.85rem;
}

.ff-step__title {
  margin: 0 0 0.55rem;
  font-family: var(--ff-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ff-white);
}

.ff-step__text {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.55;
  font-size: 0.98rem;
}

/* ---- Types ---- */
.ff-types {
  padding: var(--ff-section-pad) 0;
  background: var(--ff-paper);
}

.ff-types__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 0 var(--ff-gutter);
  max-width: 1200px;
  margin: 0 auto;
}

.ff-type {
  position: relative;
  display: block;
  aspect-ratio: 16 / 11;
  border-radius: var(--ff-radius);
  overflow: hidden;
  text-decoration: none !important;
  color: var(--ff-white) !important;
}

.ff-type img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ff-ease);
}

.ff-type span {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}

.ff-type::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(18, 22, 28, 0.75) 100%);
}

.ff-type:hover img {
  transform: scale(1.05);
}

/* ---- Quotes ---- */
.ff-quotes {
  padding: var(--ff-section-pad) 0;
  background: var(--ff-white);
}

.ff-quote {
  flex: 0 0 min(88vw, 380px);
  scroll-snap-align: start;
  margin: 0;
  padding: 1.6rem 1.5rem;
  background: var(--ff-paper);
  border-radius: var(--ff-radius);
  border-left: 3px solid var(--ff-accent);
}

.ff-quote p {
  margin: 0 0 1.15rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ff-ink-soft);
}

.ff-quote footer {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ff-quote strong {
  font-family: var(--ff-display);
  font-size: 1rem;
  color: var(--ff-ink);
}

.ff-quote span {
  font-size: 0.88rem;
  color: var(--ff-muted);
}

/* ---- CTA ---- */
.ff-cta {
  padding: var(--ff-section-pad) var(--ff-gutter);
  background:
    linear-gradient(120deg, rgba(18, 22, 28, 0.72), rgba(27, 92, 75, 0.55)),
    url('../images/resources/banner-img1.webp') center/cover no-repeat;
  background-color: var(--ff-ink);
}

.ff-cta__inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  color: var(--ff-white);
}

.ff-cta__title {
  margin: 0 0 0.85rem;
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.5vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ff-white);
}

.ff-cta__lead {
  margin: 0 auto 1.6rem;
  max-width: 36rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
  line-height: 1.55;
}

.ff-cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.ff-cta .ff-btn--ghost-dark {
  color: var(--ff-white) !important;
  border-color: rgba(255, 255, 255, 0.45);
}

.ff-cta .ff-btn--ghost-dark:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Homepage chrome softening around redesigned sections */
body:has(.ff-hero) .top-header {
  display: none;
}

body:has(.ff-hero) .header.widget_edit_enabled {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

body:has(.ff-hero) .header .navbar-brand,
body:has(.ff-hero) .header .navbar-brand img {
  filter: brightness(0) invert(1);
}

body:has(.ff-hero) .header .navbar-brand {
  width: 35%;
  max-width: 35%;
  margin-right: 1.5rem;
}

body:has(.ff-hero) .header .navbar-brand img {
  width: 100%;
  max-width: 100%;
  height: auto;
}

body:has(.ff-hero) .header .nav-link,
body:has(.ff-hero) .header .navbar-nav .nav-link,
body:has(.ff-hero) .header .signin-btn .nav-link,
body:has(.ff-hero) .header .menu-button .icon-spar {
  color: #fff !important;
}

body:has(.ff-hero) .header .navbar-nav a {
  color: rgba(255, 255, 255, 0.92) !important;
}

body:has(.ff-hero) .bottom.section-padding {
  background: var(--ff-ink);
  color: rgba(255, 255, 255, 0.75);
  padding-top: 3rem;
}

body:has(.ff-hero) .footer {
  background: #0c1014;
}

body:has(.ff-hero) .footer-placeholder {
  display: none;
}

/* Motion */
@keyframes ff-rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes ff-hero-ken {
  from {
    transform: scale(1.08);
  }
  to {
    transform: scale(1.02);
  }
}

/* Responsive */
@media (max-width: 991px) {
  .ff-steps__list {
    grid-template-columns: 1fr;
  }

  .ff-types__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:has(.ff-hero) .header.widget_edit_enabled {
    position: relative;
    background: var(--ff-ink) !important;
  }

  body:has(.ff-hero) .header .navbar-collapse {
    background: rgba(18, 22, 28, 0.98);
    padding: 1rem;
    border-radius: 12px;
  }
}

@media (max-width: 640px) {
  .ff-types__grid {
    grid-template-columns: 1fr;
  }

  .ff-section-head--row {
    align-items: flex-start;
  }

  .ff-section-head__aside {
    width: 100%;
    padding-right: var(--ff-gutter);
    justify-content: space-between;
  }

  .ff-hero__actions {
    width: 100%;
  }

  .ff-hero__actions .ff-btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ff-hero__media,
  .ff-hero__brand,
  .ff-hero__title,
  .ff-hero__lead,
  .ff-hero__actions,
  .ff-hero__search,
  [data-ff-reveal] {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Full-width navbar */
.header > .ff-nav-container,
.header > .container-fluid.ff-nav-container {
  width: 100%;
  max-width: 100%;
  padding-left: clamp(1rem, 3vw, 2.5rem);
  padding-right: clamp(1rem, 3vw, 2.5rem);
}

.header > .ff-nav-container > .row {
  margin-left: 0;
  margin-right: 0;
}

.header > .ff-nav-container > .row > [class*="col-"] {
  padding-left: 0;
  padding-right: 0;
}

.header .navbar {
  width: 100%;
}

/* Auth popup: login + register tabs */
.ff-auth-popup {
  width: min(420px, calc(100vw - 2rem));
  max-height: min(90vh, 720px);
  overflow: auto;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(18, 22, 28, 0.28);
}

.ff-auth-tabs {
  display: flex;
  background: #d8d8d9;
}

.ff-auth-tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 16px 12px;
  font-size: 15px;
  font-weight: 600;
  color: #5c6570;
  cursor: pointer;
}

.ff-auth-tab.is-active {
  background: #fff;
  color: #12161c;
}

.ff-auth-pane {
  display: none;
}

.ff-auth-pane.is-active {
  display: block;
}

.ff-auth-popup > .ff-auth-pane > h3 {
  color: #242526;
  font-size: 18px;
  font-weight: 500;
  background-color: transparent;
  padding: 18px 0 0;
  margin: 0;
}

.ff-auth-popup .popup-form > form {
  border-bottom: 0;
  margin-bottom: 12px;
  padding-top: 24px;
}

.ff-auth-popup .alerts-box {
  text-align: left;
  margin-bottom: 10px;
  color: #c0392b;
  font-size: 13px;
}

.ff-auth-popup .form_captcha {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.ff-auth-popup .form_captcha img {
  margin: 0 auto;
}
