/* =========================================================
   UI/UX LAYER — aplicado ao projeto Fitness
   Foco: feedback visual, acessibilidade, microinterações,
   estados de loading/vazio/sucesso, navegação e performance.
========================================================= */

:root{
  --uiux-focus:#111111;
  --uiux-overlay:rgba(255,255,255,.92);
  --uiux-success:#1f7a3f;
  --uiux-warning:#8a6100;
  --uiux-error:#a51d2d;
  --uiux-info:#252525;
  --uiux-soft:#f5f5f5;
  --uiux-line:#dedede;
  --uiux-shadow:0 14px 38px rgba(0,0,0,.14);
}

html{
  scroll-padding-top:84px;
}

body{
  min-height:100vh;
}

body.uiux-ready [data-uiux-animate]{
  opacity:0;
  transform:translateY(14px);
  transition:opacity .45s ease, transform .45s ease;
}

body.uiux-ready [data-uiux-animate].uiux-visible{
  opacity:1;
  transform:translateY(0);
}

body.uiux-loading{
  overflow:hidden;
}

.uiux-page-loader{
  position:fixed;
  inset:0;
  z-index:9999;
  display:grid;
  place-items:center;
  background:var(--uiux-overlay);
  backdrop-filter:blur(10px);
  transition:opacity .25s ease, visibility .25s ease;
}

.uiux-page-loader.is-hidden{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}

.uiux-loader-card{
  width:min(320px, calc(100% - 36px));
  padding:22px;
  border:1px solid var(--uiux-line);
  border-radius:24px;
  background:#fff;
  box-shadow:var(--uiux-shadow);
  text-align:center;
}

.uiux-spinner{
  width:34px;
  height:34px;
  margin:0 auto 14px;
  border:4px solid #e7e7e7;
  border-top-color:#111;
  border-radius:50%;
  animation:uiux-spin .7s linear infinite;
}

.uiux-loader-title{
  margin:0 0 6px;
  color:#111;
  font-size:15px;
  font-weight:900;
}

.uiux-loader-text{
  margin:0;
  color:#666;
  font-size:13px;
  font-weight:700;
  line-height:1.4;
}

@keyframes uiux-spin{
  to{transform:rotate(360deg)}
}

.uiux-toast-region{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:9998;
  display:grid;
  gap:10px;
  width:min(360px, calc(100vw - 36px));
  pointer-events:none;
}

.uiux-toast{
  padding:14px 16px;
  border:1px solid var(--uiux-line);
  border-left:5px solid var(--uiux-info);
  border-radius:18px;
  background:#fff;
  box-shadow:var(--uiux-shadow);
  color:#111;
  font-size:13px;
  font-weight:800;
  line-height:1.35;
  pointer-events:auto;
  transform:translateY(10px);
  opacity:0;
  animation:uiux-toast-in .22s ease forwards;
}

.uiux-toast.success{border-left-color:var(--uiux-success)}
.uiux-toast.warning{border-left-color:var(--uiux-warning)}
.uiux-toast.error{border-left-color:var(--uiux-error)}

@keyframes uiux-toast-in{
  to{opacity:1;transform:translateY(0)}
}

.uiux-back-top{
  position:fixed;
  right:18px;
  bottom:88px;
  z-index:80;
  width:44px;
  height:44px;
  border:1px solid var(--uiux-line);
  border-radius:50%;
  background:#111;
  color:#fff;
  display:grid;
  place-items:center;
  font-size:18px;
  font-weight:900;
  box-shadow:var(--uiux-shadow);
  opacity:0;
  transform:translateY(10px);
  pointer-events:none;
  transition:.2s ease;
}

.uiux-back-top.is-visible{
  opacity:1;
  transform:translateY(0);
  pointer-events:auto;
}

.uiux-back-top:hover{
  transform:translateY(-2px);
}

.uiux-progress{
  position:fixed;
  top:0;
  left:0;
  z-index:9997;
  height:3px;
  width:0%;
  background:#111;
  transition:width .08s linear;
}

.uiux-active-link{
  background:#111 !important;
  color:#fff !important;
}

.uiux-searching{
  position:relative;
}

.uiux-searching::after{
  content:"";
  position:absolute;
  right:12px;
  top:50%;
  width:14px;
  height:14px;
  margin-top:-7px;
  border:2px solid #d7d7d7;
  border-top-color:#111;
  border-radius:50%;
  animation:uiux-spin .65s linear infinite;
}

input.uiux-has-value{
  border-color:#111 !important;
  box-shadow:0 0 0 3px rgba(0,0,0,.08);
}

.filter-btn,
.language-option,
.nav-link,
.btn,
.unit-card,
.club-card,
.plan-card,
.plan-detail-card,
.quick-card,
.info-card,
.amenity-card,
.site-perk-slide,
.benefit-card{
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    border-color .18s ease,
    background .18s ease,
    color .18s ease,
    opacity .18s ease;
}

.unit-card:hover,
.club-card:hover,
.plan-card:hover,
.plan-detail-card:hover,
.quick-card:hover,
.info-card:hover,
.amenity-card:hover,
.site-perk-slide:hover,
.benefit-card:hover{
  transform:translateY(-3px);
  box-shadow:0 10px 24px rgba(0,0,0,.10);
}

.unit-card:focus-within,
.club-card:focus-within,
.plan-card:focus-within,
.plan-detail-card:focus-within{
  border-color:#111 !important;
  box-shadow:0 0 0 3px rgba(0,0,0,.10);
}

.btn:active,
.filter-btn:active,
.circle-btn:active,
.hamburger:active{
  transform:translateY(1px) scale(.98);
}

.uiux-empty-helper{
  padding:18px;
  border:1px dashed #bbb;
  border-radius:18px;
  background:#fff;
  color:#666;
  font-size:14px;
  font-weight:800;
  text-align:center;
}

.uiux-skeleton{
  position:relative;
  overflow:hidden;
  background:#e8e8e8 !important;
}

.uiux-skeleton::after{
  content:"";
  position:absolute;
  inset:0;
  transform:translateX(-100%);
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
  animation:uiux-shimmer 1.2s infinite;
}

@keyframes uiux-shimmer{
  to{transform:translateX(100%)}
}

.uiux-status-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

.uiux-pill{
  min-height:26px;
  padding:0 10px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  gap:7px;
  background:#f0f0f0;
  color:#555;
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
}

.uiux-pill.success{
  background:#e9f5ee;
  color:#165d32;
}

.uiux-pill.success::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--uiux-success);
}

.uiux-link-preview{
  position:fixed;
  z-index:9996;
  max-width:320px;
  padding:10px 12px;
  border:1px solid var(--uiux-line);
  border-radius:14px;
  background:#fff;
  box-shadow:var(--uiux-shadow);
  color:#333;
  font-size:12px;
  font-weight:750;
  line-height:1.35;
  opacity:0;
  transform:translateY(6px);
  pointer-events:none;
  transition:.14s ease;
}

.uiux-link-preview.is-visible{
  opacity:1;
  transform:translateY(0);
}

.leaflet-popup-content-wrapper{
  border-radius:18px !important;
}

.leaflet-popup-content{
  margin:14px !important;
}

@media (max-width:720px){
  .uiux-toast-region{
    right:12px;
    bottom:12px;
    width:calc(100vw - 24px);
  }

  .uiux-back-top{
    right:12px;
    bottom:82px;
  }

  .uiux-page-loader{
    align-items:end;
    padding-bottom:18px;
  }
}

@media (prefers-reduced-motion:reduce){
  *,
  *::before,
  *::after{
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    scroll-behavior:auto !important;
    transition-duration:.01ms !important;
  }

  body.uiux-ready [data-uiux-animate]{
    opacity:1 !important;
    transform:none !important;
  }
}
