/* ==========================================================================
   COMPONENTS — buttons, cards, badges, forms, accordion, carousel, fab
   ========================================================================== */

/* ---- Grid utilities -------------------------------------------------------*/
.grid { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-sm);
  padding: 0.95em 1.85em;
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.btn svg { width: 17px; height: 17px; transition: transform var(--dur-base) var(--ease-out); flex-shrink: 0; }

.btn--gold { background: var(--gradient-gold); color: var(--ink-navy); box-shadow: var(--shadow-gold); }
.btn--gold:hover { transform: translateY(-3px); box-shadow: 0 22px 42px rgba(150, 112, 43, 0.4); }
.btn--gold:hover svg { transform: translateX(3px); }

.btn--navy { background: var(--brand-navy); color: var(--white); }
.btn--navy:hover { background: var(--ink-navy); transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.btn--outline { background: transparent; border: 1.5px solid var(--border-strong); color: var(--ink-navy); }
.btn--outline:hover { border-color: var(--brand-navy); background: var(--mist); }

.btn--outline-light { background: transparent; border: 1.5px solid rgba(255,255,255,0.35); color: var(--white); }
.btn--outline-light:hover { border-color: var(--white); background: rgba(255,255,255,0.08); }

.btn--ghost { padding: 0.4em 0; border-radius: 0; color: var(--brand-navy); border-bottom: 1.5px solid var(--border-strong); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-deep); gap: 0.9em; }

.btn--lg { padding: 1.15em 2.35em; font-size: var(--fs-md); }
.btn--block { width: 100%; }

.card-link { display: inline-flex; align-items: center; gap: 0.5em; font-size: var(--fs-sm); font-weight: 600; color: var(--brand-navy); }
.card-link svg { width: 15px; height: 15px; transition: transform var(--dur-base) var(--ease-out); }
.card-link:hover { color: var(--gold-deep); }
.card-link:hover svg { transform: translateX(4px); }

/* ---- Base card ---------------------------------------------------------*/
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.card:hover { transform: translateY(-7px); box-shadow: var(--shadow-lg); border-color: transparent; }

/* ---- Media placeholders (stand-ins for photography) ---------------------*/
.media-placeholder {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-navy);
  color: rgba(255,255,255,0.9);
  isolation: isolate;
}
.media-placeholder::after {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(circle at 25% 15%, rgba(255,255,255,0.18), transparent 60%);
}
.media-placeholder svg { position: relative; z-index: 1; width: 26%; height: 26%; }
.media-placeholder--a { background: linear-gradient(135deg, #1D5494, #0B2647); }
.media-placeholder--b { background: linear-gradient(135deg, #2C6CB0, #154379); }
.media-placeholder--c { background: linear-gradient(135deg, var(--gold-light), var(--gold-deep)); color: var(--ink-navy); }
.media-placeholder--d { background: linear-gradient(135deg, #154379, #0B2647); }

.avatar {
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--white);
  background: var(--gradient-navy);
  flex-shrink: 0;
  position: relative;
  isolation: isolate;
}
.avatar::after { content:''; position:absolute; inset:0; z-index:0; border-radius: inherit; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.22), transparent 60%); }
.avatar span { position: relative; z-index: 1; }
.avatar--sm { width: 48px; height: 48px; font-size: 0.95rem; }
.avatar--md { width: 64px; height: 64px; font-size: 1.2rem; }

/* ---- Badges / tags -------------------------------------------------------*/
.badge {
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 0.75em 1.3em;
  border-radius: var(--radius-full);
  background: var(--white);
  border: 1px solid var(--border-soft);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-soft);
}
.badge svg { width: 16px; height: 16px; color: var(--gold-deep); flex-shrink: 0; }

.tag {
  display: inline-block;
  padding: 0.35em 0.95em;
  border-radius: var(--radius-full);
  background: var(--mist-deep);
  color: var(--brand-navy);
  font-size: var(--fs-xs);
  font-weight: 600;
}

/* ---- Stars / quote -------------------------------------------------------*/
.stars { display: inline-flex; gap: 3px; color: var(--gold); }
.stars svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }

.quote-mark { width: 32px; height: 32px; color: var(--gold-light); margin-bottom: var(--space-sm); }

/* ---- Glass chip (hero readout tags) --------------------------------------*/
.glass-chip {
  display: flex; align-items: center; gap: 0.85em;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: var(--radius-md);
  padding: 0.8em 1.25em;
  box-shadow: var(--shadow-lg);
}
.glass-chip__icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--gradient-gold);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.glass-chip__icon svg { width: 19px; height: 19px; color: var(--ink-navy); }
.glass-chip__label { display: block; font-size: 0.68rem; color: var(--gray-500); font-weight: 500; letter-spacing: 0.02em; }
.glass-chip__value { display: block; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm); color: var(--ink-navy); line-height: 1.3; margin-top: 0.1em; }

/* ---- Circular dial (stat rings) -------------------------------------------*/
.dial { position: relative; width: 118px; height: 118px; margin-inline: auto; }
.dial svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.dial circle { fill: none; stroke-width: 6; }
.dial__track { stroke: rgba(255,255,255,0.14); }
.dial__progress { stroke: var(--gold); stroke-linecap: round; }
.dial__value {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 600; font-size: var(--fs-md); color: var(--white);
}
.dial--lg { width: 172px; height: 172px; }
.dial--lg .dial__value { font-size: var(--fs-2xl); }

/* Completion flash: a one-shot ring pulse fired by JS (adds .is-complete to
   the .dial) the instant the sweep/counter finishes — the little "reward"
   tick that makes the ring feel alive rather than just decorative. */
.dial__flash {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid var(--gold);
  opacity: 0;
  pointer-events: none;
}
.dial.is-complete .dial__flash { animation: dialFlash 0.85s var(--ease-out); }
@keyframes dialFlash {
  0%   { transform: scale(0.86); opacity: 0.9; }
  100% { transform: scale(1.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dial.is-complete .dial__flash { animation: none; }
}

/* ---- Stat card (data-card used in the stats-band bento grid) -----------*/
.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(165deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.5s var(--ease-out), border-color 0.5s var(--ease-out),
              box-shadow 0.5s var(--ease-out), background 0.5s var(--ease-out);
}
.stat-card::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(circle at var(--mx, 30%) var(--my, 0%), rgba(198,154,70,0.18), transparent 60%);
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}
.stat-card:hover {
  transform: translateY(-6px);
  border-color: rgba(198,154,70,0.45);
  background: linear-gradient(165deg, rgba(255,255,255,0.09), rgba(255,255,255,0.02));
  box-shadow: 0 26px 50px rgba(3, 12, 26, 0.35);
}
.stat-card:hover::before { opacity: 1; }

.stat-card__corner { position: absolute; width: 16px; height: 16px; opacity: 0; transition: opacity 0.5s var(--ease-out); }
.stat-card__corner--tl { top: 12px; left: 12px; border-top: 1.5px solid var(--gold); border-left: 1.5px solid var(--gold); border-radius: 4px 0 0 0; }
.stat-card__corner--br { bottom: 12px; right: 12px; border-bottom: 1.5px solid var(--gold); border-right: 1.5px solid var(--gold); border-radius: 0 0 4px 0; }
.stat-card:hover .stat-card__corner { opacity: 0.85; }

.stat-card__icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-md);
  color: var(--gold-light);
}
.stat-card__icon svg { width: 19px; height: 19px; }

.stat-card__kicker {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: var(--space-md);
}

.stat-card__label {
  margin-top: var(--space-md);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--white);
}
.stat-card--spotlight .stat-card__label { font-size: var(--fs-lg); }

.stat-card__caption {
  margin-top: 0.4rem;
  font-size: var(--fs-xs);
  color: rgba(255,255,255,0.55);
  max-width: 24ch;
  line-height: 1.5;
}

.stat-card--spotlight {
  border-color: rgba(198,154,70,0.4);
  background: linear-gradient(165deg, rgba(198,154,70,0.16), rgba(255,255,255,0.02));
  padding: var(--space-xl) var(--space-lg);
  justify-content: center;
}
.stat-card--spotlight .stat-card__corner { opacity: 0.55; }
.stat-card--spotlight:hover .stat-card__corner { opacity: 1; }
.stat-card--spotlight .stat-card__caption { max-width: 30ch; }

/* ---- Forms -----------------------------------------------------------*/
.form-field { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: var(--space-md); }
.form-field label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-navy); }
.form-field input, .form-field select, .form-field textarea {
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 0.9em 1.1em;
  font-size: var(--fs-base);
  font-family: var(--font-body);
  background: var(--white);
  transition: border-color var(--dur-fast) var(--ease-out);
  width: 100%;
}
.form-field textarea { resize: vertical; min-height: 110px; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--gold); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* ---- Accordion (FAQ) ---------------------------------------------------*/
.accordion-item { border-bottom: 1px solid var(--border-soft); }
.accordion-item__trigger {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-md);
  padding-block: 1.6rem;
  text-align: left;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-navy);
}
.accordion-item__icon {
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--mist);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: background var(--dur-base) var(--ease-out);
}
.accordion-item__icon span { position: absolute; background: var(--brand-navy); border-radius: 2px; transition: transform var(--dur-base) var(--ease-in-out), opacity var(--dur-fast); }
.accordion-item__icon span:nth-child(1) { width: 14px; height: 2px; }
.accordion-item__icon span:nth-child(2) { width: 2px; height: 14px; }
.accordion-item.is-open .accordion-item__icon { background: var(--gradient-gold); }
.accordion-item.is-open .accordion-item__icon span { background: var(--ink-navy); }
.accordion-item.is-open .accordion-item__icon span:nth-child(2) { transform: rotate(90deg); opacity: 0; }
.accordion-item__panel { height: 0; overflow: hidden; }
.accordion-item__panel-inner { padding-bottom: 1.8rem; color: var(--gray-500); font-size: var(--fs-base); line-height: var(--lh-normal); max-width: 660px; }

/* ---- Carousel (testimonials) -------------------------------------------*/
.carousel { position: relative; }
.carousel__viewport { overflow: hidden; }
.carousel__track { display: flex; will-change: transform; }
.carousel__slide { flex: 0 0 100%; padding-right: 4px; }
.carousel__controls { display: flex; align-items: center; justify-content: center; gap: var(--space-lg); margin-top: var(--space-xl); }
.carousel__dots { display: flex; gap: 0.5rem; }
.carousel__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gray-200); transition: all var(--dur-base) var(--ease-out); }
.carousel__dot.is-active { background: var(--gold); width: 26px; border-radius: var(--radius-full); }
.carousel__arrow {
  width: 48px; height: 48px; border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur-base) var(--ease-out);
  flex-shrink: 0;
}
.carousel__arrow:hover { background: var(--ink-navy); border-color: var(--ink-navy); color: var(--white); }
.carousel__arrow svg { width: 18px; height: 18px; }

/* ---- Floating action buttons -------------------------------------------*/
.fab-group {
  position: fixed;
  right: clamp(1rem, 3vw, 2.25rem);
  bottom: clamp(1rem, 3vw, 2.25rem);
  z-index: var(--z-fab);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}
.fab {
  position: relative;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(18px) scale(0.8);
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), background var(--dur-fast);
}
.fab.is-visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.fab svg { width: 20px; height: 20px; }

/* WhatsApp FAB */
.fab-whatsapp-wrap { position: relative; }
.fab--whatsapp {
  width: 56px; height: 56px;
  background: #25D366;
  color: var(--white);
  box-shadow: 0 10px 26px rgba(37, 211, 102, 0.4), var(--shadow-md);
}
.fab--whatsapp:hover { background: #1FBF5C; transform: translateY(-2px) scale(1.04); }
.fab--whatsapp.is-visible:hover { transform: translateY(-2px) scale(1.04); }
.fab--whatsapp svg { width: 26px; height: 26px; }
.fab__badge {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 19px; height: 19px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: #FF3B30;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--white);
  animation: pulseDot 2.4s ease-in-out infinite;
}

/* Back-to-top FAB with live scroll-progress ring */
.fab--top {
  width: 42px; height: 42px;
  background: var(--white);
  color: var(--brand-navy);
}
.fab--top:hover { color: var(--ink-navy); }
.fab--top:hover .fab__ring-track { stroke: var(--gray-300); }
.fab__ring {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}
.fab__ring-track {
  fill: none;
  stroke: var(--border-soft);
  stroke-width: 2.5;
  transition: stroke var(--dur-fast);
}
.fab__ring-progress {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 116.24; /* 2 * PI * r(18.5) */
  stroke-dashoffset: 116.24;
  transition: stroke-dashoffset 0.1s linear;
}
.fab__arrow { position: relative; z-index: 1; }

/* ---- Chat notification popup --------------------------------------------*/
.chat-popup {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  width: 236px;
  background: var(--white);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.85rem 1.6rem 0.85rem 1rem;
  opacity: 0;
  visibility: hidden;
  transform: translate(10px, -50%) scale(0.94);
  transform-origin: center right;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out), visibility 0.35s;
  pointer-events: none;
}
.chat-popup.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%) scale(1);
  pointer-events: auto;
}
.chat-popup__text {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.86rem;
  line-height: var(--lh-snug);
  font-weight: 600;
  color: var(--ink-navy);
  cursor: pointer;
}
.chat-popup__text em { color: var(--gold-deep); font-style: normal; }
.chat-popup__dot {
  flex-shrink: 0;
  width: 8px; height: 8px;
  margin-top: 0.3rem;
  border-radius: 50%;
  background: #FF3B30;
  animation: pulseDot 1.8s ease-in-out infinite;
}
.chat-popup__close {
  position: absolute;
  top: 0.55rem; right: 0.55rem;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  border-radius: 50%;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.chat-popup__close:hover { color: var(--ink-navy); background: var(--mist); }
.chat-popup__tail {
  position: absolute;
  right: -7px;
  top: 50%;
  width: 14px; height: 14px;
  background: var(--white);
  border-right: 1.5px solid var(--border-soft);
  border-bottom: 1.5px solid var(--border-soft);
  transform: translateY(-50%) rotate(-45deg);
  border-radius: 0 0 3px 0;
}

@media (max-width: 480px) {
  .chat-popup { right: -10px; width: min(230px, calc(100vw - 96px)); }
}

/* ---- Divider ------------------------------------------------------------*/
.rule { height: 1px; background: var(--border-soft); border: none; width: 100%; }

/* ---- Video lightbox (shared component, any [data-video-lightbox] trigger) */
.video-lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-md);
  visibility: hidden;
  pointer-events: none;
}
.video-lightbox.is-open { visibility: visible; pointer-events: auto; }
.video-lightbox__backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 18, 33, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
}
.video-lightbox__panel {
  position: relative;
  width: min(920px, 100%);
  opacity: 0;
  transform: scale(0.96) translateY(14px);
}
.video-lightbox__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #000;
}
.video-lightbox__frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-lightbox__title {
  margin-top: var(--space-sm);
  text-align: center;
  color: rgba(255,255,255,0.85);
  font-size: var(--fs-sm);
}
.video-lightbox__close {
  position: absolute; top: -46px; right: 0;
  width: 38px; height: 38px;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast) var(--ease-out);
}
.video-lightbox__close:hover { background: rgba(255,255,255,0.22); }

@media (max-width: 560px) {
  .video-lightbox__close { top: auto; bottom: calc(100% + 10px); right: 0; }
}
