/* Legal Popup Engine v5-MAM — legal_popup_strategy_constitution.md
   Colors: #050505 / #C5A46F · isolated from home-standard.css */

.legal-popup {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(5, 5, 5, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: legal-popup-fade 0.28s ease;
  font-family: "Tajawal", system-ui, sans-serif;
}

html[lang="en"] .legal-popup,
html[dir="ltr"] .legal-popup {
  font-family: "Inter", system-ui, sans-serif;
}

.legal-popup[hidden] {
  display: none !important;
}

html.legal-popup-open {
  overflow: hidden;
}

@keyframes legal-popup-fade {
  from { opacity: 0.001; }
  to { opacity: 1; }
}

.legal-popup__card {
  position: relative;
  width: min(32rem, 100%);
  border-radius: 16px;
  padding: 2rem 1.65rem 1.65rem;
  background: #050505;
  border: 1px solid rgba(197, 164, 111, 0.5);
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(197, 164, 111, 0.16);
  animation: legal-popup-rise 0.32s ease;
  color: #f5f0e6;
  text-align: start;
}

.legal-popup__card::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 1.4rem;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, #c5a46f 0%, #d4af37 50%, #c5a46f 100%);
}

@keyframes legal-popup-rise {
  from { transform: translateY(14px); opacity: 0.85; }
  to { transform: translateY(0); opacity: 1; }
}

.legal-popup__eyebrow {
  display: inline-block;
  margin: 0 0 0.45rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(197, 164, 111, 0.14);
  color: #d4af37;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.legal-popup__area {
  margin: 0 0 0.55rem;
  color: rgba(245, 240, 230, 0.72);
  font-size: 0.84rem;
  font-weight: 600;
}

.legal-popup__close {
  position: absolute;
  top: 0.7rem;
  inset-inline-end: 0.75rem;
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid rgba(197, 164, 111, 0.35);
  border-radius: 999px;
  background: transparent;
  color: #c5a46f;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.legal-popup__close:hover,
.legal-popup__close:focus-visible {
  background: rgba(197, 164, 111, 0.12);
  border-color: #d4af37;
  outline: none;
}

.legal-popup__title {
  margin: 0 0 0.65rem;
  padding-inline-end: 1.85rem;
  color: #f8f4ec;
  font-size: clamp(1.22rem, 2.7vw, 1.48rem);
  font-weight: 800;
  line-height: 1.32;
}

html[dir="rtl"] .legal-popup__title {
  padding-inline-end: 0;
  padding-inline-start: 1.85rem;
}

.legal-popup__text {
  margin: 0 0 0.75rem;
  color: rgba(245, 240, 230, 0.88);
  font-size: 1.02rem;
  line-height: 1.7;
}

.legal-popup__trust {
  margin: 0 0 1.2rem;
  color: #c5a46f;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.legal-popup__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.legal-popup__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(197, 164, 111, 0.45);
  background: transparent;
  color: #f5f0e6;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.legal-popup__btn-label {
  display: block;
  text-align: center;
  line-height: 1.25;
}

.legal-popup__btn:hover,
.legal-popup__btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  outline: none;
}

.legal-popup__btn--primary {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, #d4af37, #c5a46f);
  border-color: #c5a46f;
  color: #111;
  box-shadow: 0 12px 26px rgba(197, 164, 111, 0.28);
  font-size: 1.02rem;
  min-height: 3rem;
}

.legal-popup__btn--primary:hover,
.legal-popup__btn--primary:focus-visible {
  filter: brightness(1.05);
  color: #111;
}

.legal-popup__btn--accent {
  background: transparent;
  border-color: #c5a46f;
  color: #d4af37;
}

.legal-popup__btn--whatsapp {
  background: transparent;
  border-color: rgba(197, 164, 111, 0.45);
  color: #f5f0e6;
}

@media (max-width: 575px) {
  .legal-popup {
    padding: 0.75rem;
    align-items: flex-end;
  }

  .legal-popup__card {
    width: 100%;
    border-radius: 16px 16px 12px 12px;
    padding: 1.65rem 1.25rem 1.25rem;
  }

  .legal-popup__actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legal-popup,
  .legal-popup__card,
  .legal-popup__btn {
    animation: none;
    transition: none;
  }
}
