/* =========================================================
   AQARE — Custom styles
   (Layout utilities live in tailwind.css; this file holds
    fonts, animations, components and states.)
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --ink: #1D1D1F;
  --muted: #86868B;
  --slate: #5F6B7A;
  --surface: #F5F5F7;
  --blue: #0071E3;
  --blue-2: #0A66FF;
  --logo-blue: #1769ff;
  --danger: #DC2626;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 108px; /* banner 44px + nav 64px */
}

/* ---------- Base ---------- */
html, body, #app { min-height: 100%; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body { margin: 0; }

* { font-family: 'Plus Jakarta Sans', 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif; }
[dir="rtl"] * { font-family: 'IBM Plex Sans Arabic', 'Plus Jakarta Sans', sans-serif; }
[dir="rtl"] { text-align: right; }

h1, h2, h3 {
  font-family: 'Plus Jakarta Sans', 'IBM Plex Sans Arabic', sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] .ar-heading {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
}

[role="button"]:not([aria-disabled="true"]), button:not(:disabled), label[for], select:not(:disabled), summary { cursor: pointer; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.is-hidden { display: none !important; }

/* ---------- Logo ---------- */
.logo-font, [dir="rtl"] .logo-font {
  font-family: 'Reem Kufi Fun', sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.aqare-logo {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: max-content; text-align: center; line-height: 1;
}
.aqare-logo .name {
  font-family: 'Reem Kufi Fun', sans-serif;
  font-size: clamp(39px, 4.7vw, 50px);
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  background: linear-gradient(90deg, #1769ff 0%, #5b9cff 50%, #1769ff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: aqareTextLoading 2s linear infinite;
}
.aqare-logo .subtitle {
  margin-top: clamp(6px, 1vw, 10px);
  font-family: Arial, sans-serif;
  font-size: clamp(9px, 1.1vw, 13px);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #7b8794;
  white-space: nowrap;
}
@keyframes aqareTextLoading { 0% { background-position: 200% center; } 100% { background-position: -200% center; } }

/* ---------- Splash loader ---------- */
.loader { opacity: 1; transition: opacity 0.5s ease; }
.loader.is-leaving { opacity: 0; pointer-events: none; }
.loader-skyline { color: #7b8794; line-height: 0; }
.loader-skyline svg { flex: 1 1 0; display: block; }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0; transform: translateY(28px); filter: blur(14px);
  transition: all 0.9s var(--ease-out-expo);
  will-change: transform, opacity, filter;
}
.reveal.visible { opacity: 1; transform: translateY(0); filter: blur(0); }

.stagger > * {
  opacity: 0; transform: translateY(18px); filter: blur(10px);
  transition: all 0.7s var(--ease-out-expo);
}
.stagger.visible > * { opacity: 1; transform: none; filter: blur(0); }
.stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.12s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.19s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.26s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.33s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.40s; }
.stagger.visible > *:nth-child(7) { transition-delay: 0.47s; }
.stagger.visible > *:nth-child(8) { transition-delay: 0.54s; }
.stagger.visible > *:nth-child(9) { transition-delay: 0.61s; }

/* ---------- Motion ---------- */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.float { animation: float 6s ease-in-out infinite; }
.float-delay { animation-delay: 1s; }

@keyframes pulseDot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: 0.6; } }
.pulse-dot { animation: pulseDot 2s infinite; }

@keyframes barGrow { 0% { height: 0; opacity: 0; } 100% { opacity: 1; } }
.bar-animate { animation: barGrow 0.9s var(--ease-out-expo) both; transform-origin: bottom; }

.img-hover { transition: transform 0.6s var(--ease-out-expo); }
.group:hover .img-hover { transform: scale(1.06); }

.grad-text {
  background: linear-gradient(90deg, #0071E3 0%, #42A5F5 50%, #7C4DFF 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

[dir="rtl"] .flip-rtl { display: inline-flex; transform: scaleX(-1); }
[dir="rtl"] .avatars > :not(:first-child) { margin-left: 0; margin-right: -0.5rem; }

/* ---------- Units grid switching ---------- */
.units-grid { transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease; }
.units-fade { opacity: 0; transform: translateY(8px); filter: blur(6px); }

/* ---------- Pill tabs ---------- */
.pill-group {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 6px;
  border-radius: 980px;
  background: #fff;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow-x: auto;
  max-width: 100%;
}
.pill {
  padding: 0 18px;
  height: 36px;
  border-radius: 980px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--slate);
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.pill:hover { background: rgba(0, 0, 0, 0.06); color: var(--ink); }
.pill.is-active,
.pill.is-active:hover { background: var(--blue-2); color: #fff; box-shadow: 0 2px 8px rgba(10, 102, 255, 0.28); }

/* ---------- Modals ---------- */
@keyframes modalIn { 0% { opacity: 0; transform: scale(0.95) translateY(8px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes backdropIn { 0% { opacity: 0; } 100% { opacity: 1; } }
.modal-enter { animation: modalIn 0.32s var(--ease-out-expo) forwards; }
.backdrop-enter { animation: backdropIn 0.28s ease-out forwards; }

/* ---------- Back to top ---------- */
@keyframes topBtnIn { 0% { opacity: 0; transform: translateY(12px) scale(0.9); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.top-btn-enter { animation: topBtnIn 0.32s var(--ease-out-expo) forwards; }
[dir="rtl"] #back-to-top { right: auto; left: 1.5rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 300;
  transform: translate(-50%, 16px);
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: 980px;
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.3s var(--ease-out-expo);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Contact form ---------- */
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.form-input.is-invalid { border-color: rgba(220, 38, 38, 0.55) !important; background: #FEF2F2; }
.form-input.is-invalid:focus { background: #fff; }

.field-error { margin-top: 6px; font-size: 11.5px; font-weight: 500; color: var(--danger); min-height: 0; }
.field-error:empty { display: none; }

.form-error {
  padding: 10px 14px;
  border-radius: 12px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: var(--danger);
  font-size: 12.5px; font-weight: 500;
}

.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .stagger > * { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
  .float, .pulse-dot, .aqare-logo .name, .bar-animate { animation: none !important; }
}

/* ---------- Section labels (v2 enterprise layout) ---------- */
.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: -0.005em;
  color: var(--blue);
}
.section-label::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.section-label-dark { color: #42A5F5; }

/* ---------- Capability panel switching ---------- */
.cap-panel { transition: opacity 0.2s ease, transform 0.2s ease; }
.cap-panel.is-switching { opacity: 0; transform: translateY(6px); }

/* ---------- Enterprise value grid ---------- */
.value-cell { border-bottom: 1px solid rgba(0, 0, 0, 0.08); }
@media (min-width: 640px) {
  .value-cell { border-inline-end: 1px solid rgba(0, 0, 0, 0.08); }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .value-cell:nth-child(2n) { border-inline-end: 0; }
}
@media (min-width: 1024px) {
  .value-cell:nth-child(4n) { border-inline-end: 0; }
}

select.form-input { appearance: auto; }
