/* =====================================================================
   FLYLAND — UI REFINEMENT LAYER
   ---------------------------------------------------------------------
   Surgical, additive polish loaded AFTER assets/style.css so it overrides
   cleanly. Touches presentation only (no markup/PHP/logic changes).
   Theme, colours, branding and structure are intentionally left intact.

   Contents:
     1.  Design tokens (radius / shadow / easing / transitions)
     2.  Typography rhythm
     3.  Scroll-reveal tuning (snappier, spring-like, mobile-shorter)
     4.  Card elevation + hover lift
     5.  Media-card image zoom
     6.  Buttons (hover lift + touch active feedback)
     7.  Form field focus states
     8.  Header / nav polish + mobile slide-in nav + backdrop
     9.  Footer polish
     10. Partners marquee polish
     11. Accessibility (focus-visible, tap highlight)
     12. Responsive rhythm (mobile-first padding, tablet, touch targets)
     13. prefers-reduced-motion safety net
   ===================================================================== */

/* ============ 1. DESIGN TOKENS ============ */
:root {
  /* elevation scale (navy-tinted so shadows feel on-brand, not muddy grey) */
  --r-shadow-sm: 0 2px 8px rgba(14, 77, 112, .06);
  --r-shadow-md: 0 10px 24px rgba(14, 77, 112, .10);
  --r-shadow-lg: 0 18px 44px rgba(14, 77, 112, .16);
  --r-shadow-gold: 0 12px 28px rgba(237, 184, 26, .28);

  /* radius scale (mirrors the values already used across the site) */
  --r-radius-sm: 12px;
  --r-radius-md: 20px;
  --r-radius-pill: 100px;

  /* spacing scale */
  --r-space-xs: 8px;
  --r-space-sm: 16px;
  --r-space-md: 24px;
  --r-space-lg: 40px;
  --r-section-pad-m: 56px;   /* compact, consistent mobile section rhythm */
  --r-section-pad-t: 72px;   /* intermediate tablet section rhythm */

  /* motion — spring-ish curves, GPU-friendly (transform/opacity only) */
  --r-ease-out: cubic-bezier(.16, 1, .3, 1);     /* easeOutExpo — reveals */
  --r-ease-spring: cubic-bezier(.2, .8, .2, 1.1); /* gentle overshoot — hovers */
  --r-reveal-dur: .7s;
  --r-reveal-dur-m: .5s;
  --r-tap: .22s;             /* short touch/interaction duration */
  --r-lift: 8px;             /* card hover travel */
}

/* ============ 2. TYPOGRAPHY RHYTHM ============ */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* keep big display headings from leaving lonely orphan words */
.sec-title, .hero-title, .banner-title, .price-card h3, .svc-box h3,
.detail-right h2, .offer-body h3, .pkg-card h3 {
  text-wrap: balance;
}
p, .testi-slide blockquote { text-wrap: pretty; }

/* ============ 3. SCROLL-REVEAL ============ */
/* Scroll-entrance reveals now live in assets/css/animations.css +
   assets/js/animations.js (reference-exact Animate.css timing: 1.25s / ease /
   fill both, fadeInUp/Left/Right). Kept as a numbered marker so the notes
   below stay aligned. This layer only handles interaction polish (hover/tap/
   nav/shadows/spacing), which are additions beyond the reference. */

/* ============ 4. CARD ELEVATION + HOVER LIFT ============ */
/* Resting elevation gives flat white cards depth that matches the reference. */
.price-card, .blog-card, .about-card {
  box-shadow: var(--r-shadow-sm);
}
.price-card, .blog-card, .about-card, .team-card,
.offer-card, .pkg-card, .why-card, .step, .detail-pricecard {
  /* transition is the cascade's top layer, so it animates even the lift
     that has to be forced with !important over the finished reveal anim. */
  transition: transform .42s var(--r-ease-spring),
              box-shadow .42s var(--r-ease-spring);
}

/* Desktop / real-pointer only: lift on hover.
   !important is required to win over the .anim reveal's forwards-filled
   transform:none — it is the spec-correct way to override animation fill,
   and the transition layer above it makes the change smooth both ways. */
@media (hover: hover) and (pointer: fine) {
  .price-card:hover, .blog-card:hover, .about-card:hover,
  .team-card:hover, .offer-card:hover, .pkg-card:hover,
  .why-card:hover, .step:hover, .detail-pricecard:hover {
    transform: translateY(calc(var(--r-lift) * -1)) !important;
  }
  .price-card:hover, .blog-card:hover, .about-card:hover, .detail-pricecard:hover {
    box-shadow: var(--r-shadow-lg);
  }
  /* cards that sit on photos / navy get a deeper ambient shadow */
  .team-card:hover, .offer-card:hover, .pkg-card:hover, .why-card:hover {
    box-shadow: var(--r-shadow-md);
  }
  /* the featured/popular cards lift a touch less (they already pop) */
  .price-card.popular:hover { transform: translateY(-5px) !important; }
}

/* ============ 5. MEDIA-CARD IMAGE ZOOM ============ */
/* Only on cards that already clip overflow, so nothing spills. */
@media (hover: hover) and (pointer: fine) {
  .team-card .photo, .offer-img, .pkg-card .pkg-bg {
    transition: transform .6s var(--r-ease-out);
    will-change: transform;
  }
  .team-card:hover .photo,
  .offer-card:hover .offer-img,
  .pkg-card:hover .pkg-bg { transform: scale(1.06); }
}

/* ============ 6. BUTTONS ============ */
.btn { transition: background-color .3s ease, color .3s ease,
                    transform var(--r-tap) var(--r-ease-spring),
                    box-shadow var(--r-tap) ease; }
@media (hover: hover) and (pointer: fine) {
  .btn-green:hover { transform: translateY(-2px); box-shadow: var(--r-shadow-md); }
  .btn-white:hover { transform: translateY(-2px); box-shadow: var(--r-shadow-gold); }
  .hf-submit:hover { transform: translateY(-2px); box-shadow: var(--r-shadow-gold); }
}
/* Touch feedback: hover doesn't exist on a finger, so give a crisp press. */
@media (hover: none) {
  .btn:active, .hf-submit:active, .svc-tab-btn:active, .hero-tab-btn:active,
  .detail-tab:active, .newsletter button:active, .testi-dots button:active {
    transform: scale(.96);
    transition: transform .12s ease;
  }
  .price-card:active, .blog-card:active, .team-card:active,
  .offer-card:active, .pkg-card:active, .why-card:active {
    transform: scale(.99);
    transition: transform .12s ease;
  }
}

/* ============ 7. FORM FIELD FOCUS ============ */
.hf-field:focus-within,
.contact-form .cf-field:focus-within,
.contact-form .cf-msg:focus-within {
  box-shadow: 0 0 0 2px rgba(237, 184, 26, .55);
  transition: box-shadow .2s ease;
}
.newsletter input { transition: border-color .2s ease, box-shadow .2s ease; }
.newsletter input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(237, 184, 26, .35);
}

/* ============ 8. HEADER / NAV POLISH ============ */
/* Desktop: animated underline affordance under top-level links. */
@media (min-width: 1025px) {
  .main-nav a.menu-link { position: relative; transition: color .25s ease, opacity .25s ease; }
  .main-nav a.menu-link::after {
    content: ""; position: absolute; left: 20px; right: 20px; bottom: 8px;
    height: 2px; background: var(--gold);
    transform: scaleX(0); transform-origin: left;
    transition: transform .3s var(--r-ease-out);
  }
  .main-nav a.menu-link:hover::after,
  .main-nav a.menu-link.active::after { transform: scaleX(1); }
  /* dropdown enters with a small slide instead of a flat fade */
  .main-nav .sub-menu {
    transform: translateY(8px);
    box-shadow: var(--r-shadow-md);
    transition: opacity .28s var(--r-ease-out), transform .28s var(--r-ease-out), visibility .28s;
  }
  .main-nav li:hover > .sub-menu { transform: translateY(0); }
  .main-nav .sub-menu a { transition: background .2s ease, padding-left .2s ease; }
  .main-nav .sub-menu a:hover { padding-left: 46px; }
}

/* Mobile: slide-in + fade dropdown driven by the existing .open toggle. */
@media (max-width: 1024px) {
  .main-nav {
    display: block !important;          /* keep in DOM so it can transition */
    visibility: hidden; opacity: 0;
    transform: translateY(-12px);
    pointer-events: none;
    transition: opacity .28s ease,
                transform .3s var(--r-ease-spring),
                visibility .28s;
  }
  .main-nav.open {
    visibility: visible; opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  /* sub-menus slide open smoothly */
  .main-nav .sub-menu {
    transition: none;                   /* JS toggles display; avoid jank */
  }
  /* hamburger: comfortable 44px tap target + press feedback */
  .nav-toggle {
    min-width: 44px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
    transition: transform .2s ease, background-color .2s ease;
  }
  .nav-toggle:active { transform: scale(.92); }
}

/* Backdrop behind the open mobile nav (element injected by enhance.js). */
.nav-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(6, 26, 42, .5);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.nav-backdrop.show { opacity: 1; visibility: visible; }
/* lock scroll while the menu is open (class added to <body> by enhance.js) */
body.nav-open { overflow: hidden; }

/* ============ 9. FOOTER POLISH ============ */
.footer-col li a { display: inline-block; transition: color .25s ease, transform .25s var(--r-ease-out); }
@media (hover: hover) and (pointer: fine) {
  .footer-col li a:hover { transform: translateX(4px); }
  .footer-right .socials a:hover,
  .testi-profile .socials a:hover { transform: translateY(-3px); }
}
.footer-right .socials a, .testi-profile .socials a {
  transition: background-color .3s ease, transform .3s var(--r-ease-spring);
}
.footer-bottom ul a { position: relative; }
@media (hover: hover) and (pointer: fine) {
  .footer-bottom ul a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
    background: currentColor; transform: scaleX(0); transform-origin: left;
    transition: transform .3s var(--r-ease-out);
  }
  .footer-bottom ul a:hover::after { transform: scaleX(1); }
}

/* ============ 10. PARTNERS MARQUEE POLISH ============ */
.marquee {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ============ 11. ACCESSIBILITY ============ */
a, button, input, select, textarea, .nav-toggle, .play-btn { -webkit-tap-highlight-color: transparent; }
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}
/* dark surfaces: keep the ring legible */
.hero a:focus-visible, .pricing a:focus-visible, .footer-box :focus-visible,
.banner :focus-visible, .svc-box :focus-visible {
  outline-color: var(--gold);
}

/* ============ 12. RESPONSIVE RHYTHM ============ */
/* Tablet (768–1024px): intermediate, even section padding. */
@media (min-width: 768px) and (max-width: 1024px) {
  .about, .services, .steps, .pricing, .why, .testimonials, .faq, .blog,
  .team-section, .offers, .pkg-section, .detail-section, .faq2 {
    padding-top: var(--r-section-pad-t);
    padding-bottom: var(--r-section-pad-t);
  }
}
/* Mobile (<768px): compact, consistent vertical rhythm + safe touch sizes. */
@media (max-width: 767px) {
  .about, .services, .steps, .pricing, .why, .testimonials, .faq, .blog,
  .team-section, .offers, .pkg-section, .detail-section, .faq2, .inner-partners {
    padding-top: var(--r-section-pad-m);
    padding-bottom: var(--r-section-pad-m);
  }
  /* prevent iOS zoom-on-focus everywhere (belt & braces — most are already 16px) */
  input, select, textarea { font-size: 16px; }
  /* 44px touch targets for small interactive bits */
  .testi-dots button { width: 14px; height: 14px; }
  .main-nav .sub-menu a { padding-top: 16px; padding-bottom: 16px; }
  .footer-right .socials a, .testi-profile .socials a { width: 44px; height: 44px; }
  .play-btn { width: 60px; height: 60px; }
}

/* ============ 13. REDUCED MOTION SAFETY NET ============ */
@media (prefers-reduced-motion: reduce) {
  .price-card, .blog-card, .about-card, .team-card, .offer-card, .pkg-card,
  .why-card, .step, .detail-pricecard, .btn, .hf-submit, .main-nav,
  .footer-col li a, .socials a, .nav-toggle, .sub-menu, .menu-link::after,
  .team-card .photo, .offer-img, .pkg-card .pkg-bg {
    transition: none !important;
  }
  .price-card:hover, .blog-card:hover, .about-card:hover, .team-card:hover,
  .offer-card:hover, .pkg-card:hover, .why-card:hover, .step:hover,
  .detail-pricecard:hover, .btn:hover, .team-card:hover .photo,
  .offer-card:hover .offer-img, .pkg-card:hover .pkg-bg {
    transform: none !important;
  }
  .marquee:hover .marquee-track { animation-play-state: running; }
}

/* ============ 14. LEGAL / LONG-FORM PAGES ============ */
.legal { --legal-line: rgba(14, 77, 112, .12); padding: 70px 0 110px; }
.legal .container { max-width: 1180px; }
.legal-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 50px; align-items: start;
}

/* reading-progress bar — fills as the document is read */
.legal-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gold);
  transform: scaleX(0); transform-origin: 0 50%;
  z-index: 200; transition: transform .1s linear; will-change: transform;
}

/* ---- Table of contents (sticky sidebar / collapsible on mobile) ---- */
.legal-toc { position: sticky; top: 36px; }
.legal-toc-card {
  background: #fff; border: 1px solid var(--legal-line); border-radius: 18px;
  padding: 22px 20px 18px; box-shadow: 0 30px 60px -50px rgba(14, 77, 112, .5);
}
.legal-toc-title {
  list-style: none; pointer-events: none;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--sys);
  font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--navy); margin-bottom: 12px;
}
.legal-toc-title::-webkit-details-marker { display: none; }
.legal-toc-caret { width: 16px; height: 16px; fill: var(--navy); display: none; transition: transform .25s ease; }
.legal-toc-nav { display: flex; flex-direction: column; counter-reset: toc; max-height: calc(100vh - 130px); overflow-y: auto; }
.legal-toc-link {
  position: relative; display: block;
  padding: 7px 8px 7px 34px; border-radius: 9px;
  font-size: 13.5px; line-height: 1.4; color: #5a6b78; border-bottom: none;
  transition: color .2s ease, background .2s ease;
}
.legal-toc-link::before {
  counter-increment: toc; content: counter(toc);
  position: absolute; left: 7px; top: 50%; transform: translateY(-50%);
  width: 19px; height: 19px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 600;
  color: var(--navy); background: rgba(14, 77, 112, .08); transition: all .2s ease;
}
.legal-toc-link:hover { color: var(--navy); background: rgba(14, 77, 112, .05); border-bottom: none; }
.legal-toc-link.active { color: var(--navy); font-weight: 600; background: rgba(237, 184, 26, .12); }
.legal-toc-link.active::before { color: #fff; background: var(--gold); }

/* ---- Document card ---- */
.legal-doc {
  background: #fff; border: 1px solid rgba(14, 77, 112, .10); border-radius: 20px;
  padding: 56px 60px; box-shadow: 0 40px 80px -50px rgba(14, 77, 112, .45);
}
.legal-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 26px; }
.legal-updated {
  display: inline-flex; align-items: center;
  font-family: var(--sys);
  font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: #fff; background: var(--navy); padding: 7px 15px; border-radius: 20px;
}
.legal-meta-item { font-family: var(--sys); font-size: 13px; color: #6b7785; display: inline-flex; align-items: center; gap: 6px; }
.legal-meta-item:empty { display: none; }
.legal-meta-item svg { width: 15px; height: 15px; fill: var(--gold); }
.legal-print {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sys); font-size: 13px; font-weight: 500; color: var(--navy);
  background: rgba(14, 77, 112, .06); padding: 8px 15px; border-radius: 20px;
  transition: background .2s ease;
}
.legal-print:hover { background: rgba(14, 77, 112, .12); }
.legal-print svg { width: 15px; height: 15px; fill: currentColor; }

.legal-lead { font-size: 18px; line-height: 1.75; color: var(--text); margin-bottom: 6px; }

/* ---- Summary / key-points callout ---- */
.legal-summary {
  margin: 26px 0 8px; border: 1px solid var(--legal-line); border-left: 4px solid var(--gold);
  background: linear-gradient(180deg, rgba(237,184,26,.06), rgba(14,77,112,.03));
  border-radius: 14px; padding: 22px 26px;
}
.legal-summary-title {
  font-family: 'Poppins', sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--navy); margin: 0 0 12px;
}
.legal-summary .legal-list li { margin-bottom: 8px; font-size: 15px; }
.legal-fine { margin: 12px 0 0; font-size: 12.5px; font-style: italic; color: #6b7785; line-height: 1.6; }

/* ---- Headings & body ---- */
.legal-doc h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 26px; font-weight: 500; line-height: 1.3; letter-spacing: -.5px;
  color: var(--navy); margin: 44px 0 14px;
  padding-bottom: 12px; border-bottom: 1px solid var(--legal-line); scroll-margin-top: 30px;
}
.legal-doc h2 .num {
  font-family: 'Playfair Display', serif; font-style: italic; font-weight: 500;
  color: var(--gold); margin-right: 10px;
}
.legal-doc h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 18px; font-weight: 600; line-height: 1.4; color: var(--navy); margin: 28px 0 10px;
}
.legal-doc p { font-size: 16px; line-height: 1.78; color: var(--text); margin-bottom: 16px; }
.legal-doc a { color: var(--navy); font-weight: 500; border-bottom: 1px solid rgba(14, 77, 112, .35); }
.legal-doc a:hover { color: var(--gold); border-bottom-color: var(--gold); }
.legal-list { margin: 0 0 18px; padding: 0; }
.legal-list li {
  position: relative; padding-left: 28px; margin-bottom: 11px;
  font-size: 16px; line-height: 1.7; color: var(--text);
}
.legal-list li::before {
  content: ""; position: absolute; left: 4px; top: 10px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--gold);
}
.legal-list li strong { color: var(--navy); font-weight: 600; }

/* ---- Contact callout ---- */
.legal-contact {
  margin-top: 44px; background: rgba(14, 77, 112, .05);
  border: 1px solid var(--legal-line); border-radius: 16px; padding: 30px 34px;
}
.legal-contact h2 { border: none; padding: 0; margin: 0 0 12px; }
.legal-contact p { margin-bottom: 6px; }

/* ---- Back to top ---- */
.legal-top {
  position: fixed; right: 26px; bottom: 26px; z-index: 120;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 30px -10px rgba(14, 77, 112, .6);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s, background .2s ease;
}
.legal-top:hover { background: var(--gold); }
.legal-top svg { width: 20px; height: 20px; fill: currentColor; transform: rotate(-90deg); }
.legal-top.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .legal-layout { grid-template-columns: 1fr; gap: 18px; }
  .legal-toc { position: static; top: auto; }
  .legal-toc-title { pointer-events: auto; cursor: pointer; }
  .legal-toc-caret { display: block; }
  .legal-toc-card[open] .legal-toc-caret { transform: rotate(180deg); }
  .legal-toc-nav { margin-top: 6px; max-height: none; }
}
@media (max-width: 767px) {
  .legal { padding: 36px 0 80px; }
  .legal-doc { padding: 32px 22px; border-radius: 16px; }
  .legal-doc h2 { font-size: 21px; margin-top: 36px; }
  .legal-lead { font-size: 16.5px; }
  .legal-summary { padding: 18px 18px; }
  .legal-contact { padding: 24px 20px; }
  .legal-print { margin-left: 0; }
  .legal-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}

/* ---- Print ---- */
@media print {
  .site-header, .site-footer, .banner, .legal-toc, .legal-top,
  .legal-progress, .legal-print, .partners { display: none !important; }
  body { background: #fff !important; }
  .legal { padding: 0; }
  .legal-layout { display: block; }
  .legal-doc { box-shadow: none; border: none; padding: 0; max-width: 100%; }
  .legal-doc a { color: #000; border: none; }
}
