/* UBN Group v5.34.07 — gentle interface motion (public website + CRM).
   No external library; respects OS reduced-motion settings. */

/* Native scrolling retains browser wheel/touch behaviour. No wheel hijacking. */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 105px;
}
[id] { scroll-margin-top: 105px; }

/* Controls: responsive visual feedback, never animate layout-affecting properties. */
:where(.btn, button, [role="button"], .top nav a, .crm-top-actions a,
       .mobile-bottom-nav a, .crm-desk-card, .team-card,
       .instagram-link-card, .ubn-profile-menu summary) {
  -webkit-tap-highlight-color: transparent;
  transition-property: color, background-color, border-color, box-shadow, opacity, transform;
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(.22, 1, .36, 1);
}

:where(.btn, button:not([disabled]), [role="button"], .crm-desk-card, .team-card,
       .mobile-bottom-nav a):active:not([disabled]) {
  transform: scale(.975);
}

/* Hover effects are limited to devices with a precise pointer; touch scrolling stays fluid. */
@media (hover: hover) and (pointer: fine) {
  :where(.btn, .crm-desk-card, .team-card, .instagram-link-card):hover:not([disabled]) {
    transform: translateY(-3px);
    box-shadow: 0 13px 27px rgba(21, 28, 36, .13);
  }
  :where(.top nav a, .crm-top-actions a, .mobile-bottom-nav a):hover {
    transform: translateY(-1px);
  }
  :where(.property-market-card, .property-card):hover {
    box-shadow: 0 18px 35px rgba(19, 25, 34, .14);
  }
  :where(.property-market-card, .property-card) .card-img {
    transition: transform 380ms cubic-bezier(.22, 1, .36, 1);
  }
  :where(.property-market-card, .property-card):hover .card-img {
    transform: scale(1.035);
  }
}

/* Tactile ripple is opt-in via JS and never intercepts pointer events. */
.ubn-tap-surface {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.ubn-motion-ripple {
  position: absolute;
  inset: auto;
  z-index: 2;
  display: block;
  border-radius: 50%;
  background: rgba(255, 255, 255, .32);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  opacity: 1;
  animation: ubn-ripple-out 570ms cubic-bezier(.16, 1, .3, 1) forwards;
}
.ubn-tap-surface.ubn-ripple-light .ubn-motion-ripple {
  background: rgba(30, 38, 48, .11);
}
@keyframes ubn-ripple-out {
  to { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* In-viewport reveal: CSS is only activated after the JS observer has started.
   The "translate" longhand avoids overwriting existing hover/drag transforms. */
.ubn-motion-ready .ubn-reveal:not(.ubn-revealed) {
  opacity: 0;
  translate: 0 16px;
}
.ubn-motion-ready .ubn-reveal {
  transition: opacity 540ms cubic-bezier(.22, 1, .36, 1) var(--ubn-reveal-delay, 0ms),
              translate 540ms cubic-bezier(.22, 1, .36, 1) var(--ubn-reveal-delay, 0ms),
              transform 220ms cubic-bezier(.22, 1, .36, 1),
              box-shadow 220ms cubic-bezier(.22, 1, .36, 1);
}
.ubn-motion-ready .ubn-reveal.ubn-revealed {
  opacity: 1;
  translate: 0 0;
}

/* Focus state is visible for keyboard users; form controls get a soft focus ring. */
:where(.btn, button, a, summary, [role="button"]):focus-visible {
  outline: 3px solid #e95b31;
  outline-offset: 3px;
}
:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus-visible {
  outline: 2px solid rgba(233, 91, 49, .72);
  outline-offset: 2px;
  transition: border-color 190ms ease, box-shadow 190ms ease;
}

/* Header gains subtle depth when content is scrolled. */
.top, .crm-topbar {
  transition: box-shadow 240ms ease, border-color 240ms ease;
}
.top.ubn-scrolled, .crm-topbar.ubn-scrolled {
  box-shadow: 0 10px 28px rgba(22, 27, 37, .13) !important;
}

/* A light entrance on the first public-page section; never delays navigation. */
body > main > :is(.section, .hero-logo-screen, .about-hero):first-child {
  animation: ubn-soft-appear 360ms ease-out both;
}

/* Small overlays and notifications — no positioning/drag changes. */
.flash {
  animation: ubn-soft-appear 330ms ease-out both;
}
.ubn-profile-menu[open] .ubn-profile-dropdown {
  animation: ubn-menu-appear 220ms cubic-bezier(.22, 1, .36, 1) both;
  transform-origin: top right;
}
dialog[open] {
  animation: ubn-soft-appear 230ms ease-out both;
}
@keyframes ubn-soft-appear {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes ubn-menu-appear {
  from { opacity: 0; transform: translateY(-7px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Avoid transform animations for form submissions, sorting, printing, slow devices. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }
  .ubn-motion-ready .ubn-reveal { opacity: 1 !important; translate: none !important; }
}
@media print {
  html { scroll-behavior: auto; }
  .ubn-motion-ready .ubn-reveal { opacity: 1 !important; translate: none !important; }
  .ubn-motion-ripple { display: none !important; }
}

/* UBN Group v5.34.08 — extra premium micro-interactions. */

/* Scroll progress is a tiny visual indicator, not a sticky overlay. */
.ubn-scroll-progress {
  position: fixed;
  z-index: 20005;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #db7e41, #e9b46d 55%, #f1c68b);
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  transition: opacity 180ms ease;
  will-change: transform;
}
.ubn-scroll-progress.ubn-progress-visible { opacity: 1; }

/* Accessible back-to-top shortcut. Left edge is intentionally chosen so it
   cannot cover WhatsApp or the floating AI assistant on the right. */
.ubn-backtop {
  position: fixed;
  z-index: 39;
  left: max(16px, env(safe-area-inset-left));
  bottom: calc(20px + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  background: #1d252f;
  color: #fff;
  box-shadow: 0 12px 32px rgba(20, 25, 32, .24);
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  translate: 0 12px;
  transition: opacity 210ms ease, visibility 210ms ease, translate 240ms cubic-bezier(.22,1,.36,1), background-color 210ms ease, box-shadow 210ms ease;
}
.ubn-backtop-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  translate: 0 0;
}
.ubn-backtop:focus-visible { outline: 3px solid #e7aa65; outline-offset: 3px; }
@media (hover:hover) and (pointer:fine) {
  .ubn-backtop-visible:hover { background:#bd854b; box-shadow:0 14px 30px rgba(20,25,32,.30); translate:0 -3px; }
}
@media(max-width:760px) {
  .ubn-backtop { bottom:calc(94px + env(safe-area-inset-bottom)); width:44px; height:44px; min-width:44px; }
}

/* Fine active-page indicator, no layout shifts when switching links. */
.top nav a { position: relative; }
.top nav a::after {
  content: '';
  position: absolute;
  left: 10%; right: 10%; bottom: -7px;
  height: 2px; border-radius: 99px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 250ms cubic-bezier(.22,1,.36,1);
  pointer-events: none;
}
.top nav a:is(:hover, :focus-visible, .ubn-current-page)::after { transform: scaleX(1); }
.top nav a.ubn-current-page { color: #bb763c; }
.mobile-bottom-nav a.ubn-current-page {
  background: rgba(231, 171, 104, .16);
  color: #ffe2b7;
}
.mobile-bottom-nav a.ubn-current-page span { translate: 0 -2px; }
.mobile-bottom-nav a span { transition: translate 220ms cubic-bezier(.22,1,.36,1); }

/* Gentle photo finishes, with no blank/hidden images during load. */
.property-market-media .card-img, .gallery .property-gallery-image {
  transition: filter 330ms ease, transform 380ms cubic-bezier(.22,1,.36,1);
}
@media(hover:hover) and (pointer:fine) {
  .gallery .property-gallery-image:hover { filter: saturate(1.1) brightness(1.03); }
  .property-market-card:hover .property-market-media .card-img { filter: saturate(1.08); }
  .metric-grid > .metric, .features > *, .trust-grid > * {
    transition: box-shadow 220ms ease, border-color 220ms ease;
  }
  .metric-grid > .metric:hover, .features > *:hover, .trust-grid > *:hover {
    box-shadow: 0 14px 32px rgba(24, 31, 43, .1);
  }
}

/* Compact expand animation for native FAQ/details (preserves keyboard behavior). */
details[open] > :not(summary) { animation: ubn-details-enter 220ms ease-out both; }
@keyframes ubn-details-enter {
  from { opacity: .55; translate: 0 -5px; }
  to { opacity: 1; translate: 0 0; }
}

/* Form focus, with no fake validation or submit delays. */
label:focus-within { transition: color 180ms ease; }
label:focus-within:has(input:focus-visible, select:focus-visible, textarea:focus-visible) { color: #ae713c; }

@media(prefers-reduced-motion:reduce) {
  .ubn-scroll-progress { transition:none!important; }
  .ubn-backtop { translate: none!important; }
  details[open] > :not(summary) { animation:none!important; }
  .mobile-bottom-nav a span { translate: none!important; }
}
@media print {
  .ubn-backtop, .ubn-scroll-progress { display:none!important; }
}
