/*
 * Homepage (/): secțiunile pâlniei de vânzare.
 * Se încarcă DUPĂ dor-de-mare.css (PAGE_ASSETS.index în web/components/StaticPage.tsx),
 * deci la specificitate egală regulile de aici câștigă.
 *
 * Sistem: spațiere doar în multipli de 8 (4px doar între un titlu și descrierea lui).
 * Raze: 8 (iconițe), 24 (carduri), 48 (panouri), pill (butoane).
 * Regula de imbricare: raza interioară = raza exterioară - padding (24 - 16 = 8).
 * Padding-ul orizontal al secțiunilor rămâne cel din dor-de-mare.css, ca marginile
 * conținutului să se alinieze cu restul paginii.
 */

.home-index-refresh {
  --home-navy: #0C3348;
  --home-orange: #e06b0c;
  --home-orange-soft: #F29A4A;
  --home-accent: #0aa4df;
  --home-surface: #FFFFFF;
  --home-line: var(--c-border);
  --home-line-strong: var(--c-border-strong);
  --home-icon-bg: #F1F4F8;
  --home-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.04);
  --home-shadow-hover: 0 2px 4px rgba(16, 24, 40, 0.05), 0 16px 32px rgba(16, 24, 40, 0.08);
  --home-r-icon: 8px;
  --home-r-card: 24px;
  --home-r-panel: 48px;
  --home-shadow-tint: rgba(0, 78, 108, 0.14);
}

/* ── Tipografie comună și ritm vertical ─────────────────────── */
.home-index-refresh .section-tag {
  margin: 0 0 8px;
}

.home-index-refresh .section-title {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  text-wrap: balance;
}

.home-index-refresh .section-title em {
  font-weight: 600;
}

.home-index-refresh .section-sub {
  max-width: 60ch;
  margin: 16px 0 0;
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--c-text-secondary);
  text-wrap: pretty;
}

.home-nowrap {
  display: inline-block;
}

.text-accent {
  color: var(--home-accent);
}

/* ── Hero: subtitlu pe mai multe rânduri ─────────────────────── */
@media (min-width: 769px) {
  .home-index-refresh .hero p {
    max-width: 34em;
    white-space: normal;
    line-height: 1.5;
  }
}

/* ── 1. Ce facem: servicii ───────────────────────────────────── */
.home-services {
  display: grid;
  gap: 8px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.home-service {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 23px 15px 15px;
  border: 1px solid var(--home-line);
  border-radius: var(--home-r-card);
  background: var(--home-surface);
  box-shadow: var(--home-shadow);
  color: var(--c-text);
  text-decoration: none;
  transition: transform 200ms var(--ease), border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.home-service:hover {
  transform: translateY(-2px);
  border-color: var(--home-line-strong);
  box-shadow: var(--home-shadow-hover);
}

.home-service:active {
  transform: translateY(0) scale(0.99);
}

.home-service:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 4px;
}

.home-service-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--home-r-icon);
  background: var(--home-icon-bg);
  color: var(--c-primary);
  font-size: 1.5rem;
}

.home-service-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.home-service-body strong {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
}

.home-service-body span {
  color: var(--c-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.home-service-arrow {
  flex-shrink: 0;
  margin-left: auto;
  color: var(--c-primary);
  font-size: 1.25rem;
  transition: transform 200ms var(--ease);
}

.home-service:hover .home-service-arrow {
  transform: translate(2px, -2px);
}

.home-about-mockup {
  display: block;
  width: min(100%, 472px);
  margin-right: clamp(0px, 4vw, 64px);
}

.home-about-mockup img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 24px 32px var(--home-shadow-tint));
}

/* ── 2. Cum funcționează ─────────────────────────────────────── */
.home-how-section {
  padding-top: clamp(16px, 3vw, 40px);
  padding-bottom: clamp(16px, 3vw, 40px);
  padding-left: clamp(28px, 3.4vw, 54px);
  padding-right: clamp(28px, 3.4vw, 54px);
}

.home-how-inner {
  max-width: 1358px;
  margin: 0 auto;
  padding: clamp(40px, 5vw, 72px);
  border: 1px solid var(--home-line);
  border-radius: var(--home-r-panel);
  background: var(--home-surface);
  box-shadow: var(--home-shadow);
}

.home-how-head {
  margin-bottom: 48px;
}

.home-how-track {
  position: relative;
}

.home-how-line {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--c-primary) 0%, rgba(0, 130, 181, 0.2) 100%);
  transform-origin: left center;
}

.home-how-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-how-num {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--home-icon-bg);
  color: var(--c-primary);
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 8px var(--home-surface);
}

.home-how-step h3 {
  margin: 24px 0 8px;
  color: var(--c-text);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.home-how-step p {
  max-width: 28ch;
  margin: 0;
  color: var(--c-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* ── 3. De ce noi: motive ────────────────────────────────────── */
.home-reasons {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.home-reason {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--c-border);
}

.home-reason:last-child {
  border-bottom: 1px solid var(--c-border);
}

.home-reason-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--home-r-icon);
  background: var(--home-icon-bg);
  color: var(--c-primary);
  font-size: 1.5rem;
}

.home-reason h3 {
  margin: 0 0 4px;
  color: var(--c-text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.home-reason p {
  margin: 0;
  color: var(--c-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.home-why-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  color: var(--c-primary);
  font-weight: 600;
  text-decoration: none;
}

.home-why-cta svg {
  transition: transform 200ms var(--ease);
}

.home-why-cta:hover svg {
  transform: translateX(4px);
}

.home-why-cta:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 4px;
  border-radius: var(--home-r-icon);
}

/* ── 3. De ce noi: bento ─────────────────────────────────────── */
.home-bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 560px);
  aspect-ratio: 1 / 1.05;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-bento-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--home-line);
  border-radius: var(--home-r-card);
  background: var(--home-icon-bg);
  box-shadow: var(--home-shadow);
  color: var(--c-primary);
}

.home-bento-tile[data-tone="navy"] {
  border-color: transparent;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(91, 201, 243, 0.28) 0%, transparent 60%),
    var(--home-navy);
  color: #FFFFFF;
}

.home-bento-tile[data-tone="sky"] {
  background: linear-gradient(160deg, #E8F4FA 0%, #D3EBF6 100%);
}

.home-bento-tile[data-tone="sand"] {
  background: linear-gradient(160deg, #FBF1E6 0%, #F6E2CC 100%);
  color: var(--home-orange);
}

.home-bento-tile:has(> img) {
  border: 0;
  background: var(--home-icon-bg);
}

.home-bento-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-bento-icon {
  flex-shrink: 0;
  font-size: 2rem;
}

.home-bento-label {
  color: var(--c-text);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
}

.home-bento-tile[data-tone="navy"] .home-bento-label {
  color: rgba(255, 255, 255, 0.92);
}

.home-bento-tile[data-tile="team"]  { grid-column: 1 / 3; grid-row: 1 / 3; }
.home-bento-tile[data-tile="coast"] { grid-column: 3 / 5; grid-row: 1; }
.home-bento-tile[data-tile="host"]  { grid-column: 3;     grid-row: 2; }
.home-bento-tile[data-tile="beach"] { grid-column: 4;     grid-row: 2; }
.home-bento-tile[data-tile="maya"]  { grid-column: 1 / 5; grid-row: 3; }

.home-bento-tile[data-tile="team"] .home-bento-icon { font-size: 3rem; }

/* ── Cadrare pe laptop (1200-1680px) ─────────────────────────────
 * Marginile secțiunilor = marginile hero-ului (aceeași formulă), iar textul
 * începe la aceeași linie cu titlul hero-ului.
 * Pe ecrane de laptop (16" ≈ 1536px) tot conținutul homepage-ului e scalat
 * proporțional (ca un zoom de browser), fără să-i taie din înălțime. Navbar-ul
 * și spațiul de sub el (padding-top 72px al .hero) rămân neschimbate.
 * --home-zoom e singura valoare de ajustat.
 */
@media (min-width: 1200px) and (max-width: 1680px) {
  .home-index-refresh {
    --home-zoom: 0.8;
  }

  .home-index-refresh .hero-shell,
  .home-index-refresh .search-wrapper,
  .home-index-refresh main > :not(.hero),
  .home-index-refresh footer {
    zoom: var(--home-zoom);
  }
}

/* tabletă / laptop mic: textul din "De ce noi" e mai înalt decât colajul; colajul se aliniază sus, cu titlul */
@media (min-width: 769px) and (max-width: 1120px) {
  .home-index-refresh .home-what-section .home-about-inner {
    align-items: start;
  }

  .home-index-refresh .home-what-section .home-about-media {
    padding-top: 48px;
  }
}

/* Tabletă (769-1024px): bara de căutare rămâne pe UN rând, ca pe desktop
   (dor-de-mare.css o trecea pe 2x2 cu buton lat sub 1024px). Subtitlul e limitat
   ca să nu intre sub polaroid. */
/* tabletă portret / laptop foarte mic: conținutul hero-ului urcă, ca butoanele să nu atingă bara de căutare */
@media (min-width: 769px) and (max-width: 1000px) {
  .home-index-refresh .hero-shell {
    min-height: 620px;
  }

  .home-index-refresh .hero-content {
    top: 44%;
    transform: translateY(-50%);
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .home-index-refresh .search-card {
    display: flex;
    padding: 12px 12px 12px 8px;
  }

  .home-index-refresh .search-card .search-field,
  .home-index-refresh .search-card .search-field:nth-child(2n),
  .home-index-refresh .search-card .search-field:nth-child(-n+2),
  .home-index-refresh .search-card .search-field:nth-child(n+3) {
    padding: 6px 14px;
    border-bottom: 0;
    border-right: 1px solid var(--c-border);
  }

  .home-index-refresh .search-card .search-field:last-of-type {
    border-right: 0;
  }

  .home-index-refresh .search-card .btn-search {
    grid-column: auto;
    width: 48px;
    height: 48px;
    margin: 0 0 0 8px;
    border-radius: 50%;
  }

  .home-index-refresh .search-card .btn-search span {
    display: none;
  }

  .home-index-refresh .hero p {
    max-width: 24em;
  }
}

@media (min-width: 769px) {
  .home-index-refresh .home-about-section,
  .home-index-refresh .home-what-section,
  .home-index-refresh .home-how-section,
  .home-index-refresh .testimonials-section,
  .home-index-refresh .home-contact-section {
    padding-left: clamp(12px, 3.5vw, 54px);
    padding-right: clamp(12px, 3.5vw, 54px);
  }

  /* Recenzii și Contact: aceeași casetă (1360px) și același început de text ca hero-ul.
     Marquee-ul de recenzii rămâne full-bleed în caseta lui, doar antetul e împins. */
  .home-index-refresh .testi-inner,
  .home-index-refresh .home-contact-inner {
    max-width: 1360px;
  }

  .home-index-refresh .testi-header,
  .home-index-refresh .home-contact-inner {
    padding-left: clamp(28px, 5vw, 72px);
    padding-right: clamp(28px, 5vw, 72px);
  }

  .home-index-refresh .home-about-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(32px, 4vw, 64px);
    padding-left: clamp(28px, 5vw, 72px);
    padding-right: clamp(28px, 5vw, 72px);
  }

  .home-index-refresh .home-about-media {
    display: flex;
    justify-content: center;
  }

  .home-index-refresh .home-what-images {
    margin: 0 auto;
  }

  .home-index-refresh .home-about-mockup {
    width: min(100%, 472px);
    margin: 0;
  }

}

@media (max-width: 1120px) {
  .home-how-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 40px;
  }

  .home-how-line {
    display: none;
  }

  .home-about-mockup {
    margin: 8px auto 0;
  }
}

@media (max-width: 768px) {
  .home-bento {
    width: 100%;
  }

  .home-how-section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .home-how-inner {
    padding: 40px 24px;
    border-radius: 32px;
  }

  .home-how-head {
    margin-bottom: 32px;
  }

  .home-how-steps {
    grid-template-columns: 1fr;
    row-gap: 24px;
  }

  .home-how-step {
    position: relative;
    padding-left: 64px;
  }

  .home-how-num {
    position: absolute;
    top: 0;
    left: 0;
  }

  .home-how-step h3 {
    margin-top: 8px;
  }

  .home-service {
    padding-right: 15px;
  }

  .home-about-mockup {
    width: min(100%, 344px);
  }

  /* același pill de sticlă ca celelalte tag-uri de pe mobil (dor-de-mare.css) */
  .home-how-section .section-tag {
    padding: 4px 16px;
    border: 1px solid rgba(224, 107, 12, 0.2);
    border-radius: 999px;
    background: rgba(224, 107, 12, 0.07);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-service,
  .home-service-arrow,
  .home-why-cta svg {
    transition: none;
  }

  .home-service:hover,
  .home-service:hover .home-service-arrow,
  .home-why-cta:hover svg {
    transform: none;
  }
}

/* ── Dark mode ───────────────────────────────────────────────── */
[data-theme="dark"] .home-bento-tile[data-tone="sky"],
[data-theme="dark"] .home-bento-tile[data-tone="sand"] {
  background: var(--home-icon-bg);
}

[data-theme="dark"] .home-bento-tile[data-tone="sand"] .home-bento-label,
[data-theme="dark"] .home-bento-tile[data-tone="sky"] .home-bento-label {
  color: var(--c-text);
}

[data-theme="dark"] .home-index-refresh {
  --home-surface: var(--c-surface);
  --home-line: rgba(255, 255, 255, 0.08);
  --home-line-strong: rgba(255, 255, 255, 0.16);
  --home-icon-bg: rgba(255, 255, 255, 0.06);
  --home-shadow: none;
  --home-shadow-hover: 0 16px 32px rgba(0, 0, 0, 0.35);
  --home-shadow-tint: rgba(0, 0, 0, 0.35);
}

/* ── Secțiuni pe telefon (≤768px): scară tipografică și ritm vertical comune ──
 * Fără hero. Înainte: tag 22.4/24px, titlu 30.4/32px, descriere 16/13.8px și
 * 54-56px sus/jos la fiecare secțiune (≈110px între două secțiuni albe).
 * Regulile din dor-de-mare.css au !important, de unde și !important aici.
 */
@media (max-width: 768px) {
  .home-index-refresh .home-about-section,
  .home-index-refresh .home-what-section,
  .home-index-refresh .testimonials-section,
  .home-index-refresh .home-contact-section {
    padding-top: 44px !important;
    padding-bottom: 44px !important;
  }

  .home-index-refresh :is(.home-about-section, .home-what-section, .home-how-section, .testimonials-section, .home-contact-section) .section-tag {
    font-size: 1.4rem !important;
  }

  .home-index-refresh :is(.home-about-section, .home-what-section, .home-how-section, .testimonials-section, .home-contact-section) .section-title {
    font-size: 1.9rem !important;
    line-height: 1.12 !important;
  }

  .home-index-refresh :is(.home-about-section, .home-what-section, .testimonials-section, .home-contact-section) .section-sub {
    font-size: 1rem !important;
    line-height: 1.5 !important;
  }

  /* Contact: fără spațiu gol între formular și cardul de date */
  .home-index-refresh .home-contact-inner {
    gap: 0;
  }

  .home-index-refresh .home-contact-info {
    margin-top: 24px;
  }

  .home-index-refresh .home-contact-status:empty {
    display: none;
  }
}
