/* ==========================================================================
   Site popups — cookie consent banner + preferences, welcome/landing modal,
   exit-intent modal. Behaviour lives in assets/js/hp-popups.js.
   Colours use --hp-* tokens where they exist; a few literals from the design
   package are kept for exact fidelity (WhatsApp green, dark scrims, toggle
   tracks, success chip).
   ========================================================================== */

/* ---- Keyframes (global) ---- */
@keyframes hpp-up   { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes hpp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hpp-pop  { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }

@media print { .hpp-root { display: none !important; } }

.hpp-root { font-family: var(--hp-font-ui); color: var(--hp-ink); }
.hpp-root [hidden] { display: none !important; }

/* ---- Shared buttons ---- */
.hpp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--hp-r-input); font-family: inherit; font-size: 14px;
  font-weight: 700; line-height: 1; cursor: pointer; min-height: 46px; padding: 12px 16px;
  text-decoration: none; transition: background var(--hp-t-fast), border-color var(--hp-t-fast), color var(--hp-t-fast);
}
.hpp-btn:hover { text-decoration: none; }
.hpp-btn--saffron    { background: var(--hp-saffron); color: var(--hp-ink); font-weight: 800; padding: 12px 18px; }
.hpp-btn--saffron:hover { background: var(--hp-saffron-l); }
.hpp-btn--ink        { background: var(--hp-ink); color: #fff; }
.hpp-btn--ink:hover  { background: #1a2e3b; }
.hpp-btn--outline    { background: #fff; color: var(--hp-ink); border: 1px solid var(--hp-line-16); }
.hpp-btn--outline:hover { background: var(--hp-bg); border-color: var(--hp-ink); }
.hpp-btn--ghost-dark { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .25); }
.hpp-btn--ghost-dark:hover { background: rgba(255, 255, 255, .08); }
.hpp-btn--whatsapp   { background: var(--hp-whatsapp); color: var(--hp-whatsapp-ink); }
.hpp-btn--whatsapp:hover { background: #3FE07B; }
.hpp-btn--lg { min-height: 52px; padding: 15px; font-size: 15.5px; }
.hpp-btn--lg .hp-icon { width: 18px; height: 18px; color: var(--hp-ink); }

/* ---- Close buttons ---- */
.hpp-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; min-width: 40px; border-radius: 50%; border: 0;
  background: #EEF2F3; color: var(--hp-ink); cursor: pointer; flex: 0 0 auto;
  transition: background var(--hp-t-fast);
}
.hpp-close:hover { background: var(--hp-divider); }
.hpp-close .hp-icon { width: 20px; height: 20px; }
.hpp-close--light { background: rgba(255, 255, 255, .92); }
.hpp-close--light:hover { background: #fff; }

/* ==========================================================================
   1. Cookie consent banner
   ========================================================================== */
.hpp-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 960; display: flex; justify-content: center; pointer-events: none;
  animation: hpp-up .4s cubic-bezier(.2, .7, .2, 1) both;
}
.hpp-banner__card {
  pointer-events: auto; width: min(980px, 100%); background: var(--hp-ink); color: #fff;
  border-radius: 18px; box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .6); overflow: hidden;
}
.hpp-banner__body {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px;
  padding: 18px clamp(16px, 3vw, 24px);
}
.hpp-banner__text { flex: 1 1 380px; min-width: 0; }
.hpp-banner__title { font-family: var(--hp-font-display); font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.hpp-banner__copy { font-size: 14px; line-height: 1.55; color: var(--hp-divider); }
.hpp-banner__link { color: var(--hp-saffron-ll); font-weight: 600; text-decoration: none; }
.hpp-banner__link:hover { text-decoration: underline; }
.hpp-banner__buttons { display: flex; flex-wrap: wrap; gap: 8px; flex: 0 0 auto; }
/* Phones: the 3 consent buttons must never overflow the card (which clips) — give the
   button row the full width and let each button grow/wrap so all stay visible. */
@media (max-width: 560px) {
  .hpp-banner__buttons { flex: 1 1 100%; width: 100%; }
  .hpp-banner__buttons .hpp-btn { flex: 1 1 auto; justify-content: center; text-align: center; }
}

/* ==========================================================================
   Shared scrim + dialog
   ========================================================================== */
.hpp-scrim {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 14px; animation: hpp-fade .2s both;
}
.hpp-scrim--prefs   { z-index: 985; background: rgba(7, 19, 27, .58); }
.hpp-scrim--landing { z-index: 975; background: rgba(7, 19, 27, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation-duration: .25s; }
.hpp-scrim--exit    { z-index: 975; background: rgba(7, 19, 27, .55); }
.hpp-dialog {
  background: #fff; max-height: calc(100vh - 28px); overflow: auto;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .6); animation: hpp-pop .3s both;
}

/* ==========================================================================
   2. Cookie preferences modal
   ========================================================================== */
.hpp-prefs { width: min(560px, 100%); border-radius: 22px; }
.hpp-prefs__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 8px; }
.hpp-prefs__title { font-family: var(--hp-font-display); font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.hpp-prefs__intro { margin: 0 22px 14px; font-size: 14px; line-height: 1.55; color: var(--hp-text-2); }
.hpp-cats { padding: 0 22px; }
.hpp-cat { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--hp-line-08); }
.hpp-cat__body { flex: 1; min-width: 0; }
.hpp-cat__name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15.5px; }
.hpp-cat__pill {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: var(--hp-green-tint); color: #0B5A3D; padding: 3px 8px; border-radius: var(--hp-r-pill);
}
.hpp-cat__desc { font-size: 13.5px; line-height: 1.5; color: var(--hp-muted); margin-top: 3px; }
.hpp-prefs__foot {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
  padding: 16px 22px 22px; border-top: 1px solid var(--hp-line-08);
}

/* Toggle switch */
.hpp-switch {
  flex: 0 0 auto; position: relative; width: 48px; height: 28px; border-radius: 14px;
  border: 0; padding: 0; cursor: pointer; background: #C9D2D7;
  transition: background var(--hp-t-fast);
}
.hpp-switch[aria-checked="true"] { background: var(--hp-green); }
.hpp-switch--locked { cursor: not-allowed; }
.hpp-switch--locked[aria-checked="true"] { background: #7FBFA3; }
.hpp-switch__knob {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: left var(--hp-t-fast);
}
.hpp-switch[aria-checked="true"] .hpp-switch__knob { left: 23px; }

/* ==========================================================================
   3. Welcome / landing modal
   ========================================================================== */
.hpp-landing {
  width: min(820px, 100%); border-radius: 24px; display: grid;
  grid-template-columns: .9fr 1.1fr; animation: hpp-pop .35s cubic-bezier(.2, .7, .2, 1) both;
}
.hpp-landing__media { position: relative; min-height: 420px; background: var(--hp-ink); }
.hpp-landing__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hpp-landing__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 19, 27, 0) 40%, rgba(7, 19, 27, .85)); }
.hpp-landing__cap { position: absolute; left: 20px; right: 20px; bottom: 18px; color: #fff; }
.hpp-landing__rating { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.hpp-stars { color: var(--hp-saffron-ll); letter-spacing: 1px; }
.hpp-landing__quote { font-family: var(--hp-font-display); font-size: 22px; font-weight: 700; line-height: 1.1; }
.hpp-landing__by { font-size: 12.5px; color: var(--hp-divider); margin-top: 4px; }

.hpp-landing__panel { position: relative; padding: clamp(20px, 4vw, 34px); }
.hpp-landing__panel .hpp-close { position: absolute; right: 12px; top: 12px; }
.hpp-eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--hp-saffron-ink-2); margin-bottom: 10px; }
.hpp-landing__heading { font-family: var(--hp-font-display); font-size: clamp(28px, 4vw, 38px); line-height: 1; font-weight: 700; letter-spacing: -.025em; margin: 0 0 10px; padding-right: 40px; }
.hpp-landing__intro { font-size: 15px; line-height: 1.55; color: var(--hp-text-2); margin: 0 0 16px; }

.hpp-intents { display: grid; gap: 8px; margin-bottom: 16px; }
.hpp-intent {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px;
  border: 1px solid var(--hp-line-12); color: var(--hp-ink); text-decoration: none;
  transition: border-color var(--hp-t-fast), background var(--hp-t-fast);
}
.hpp-intent:hover { border-color: var(--hp-saffron); background: #FFF8EE; color: var(--hp-ink); text-decoration: none; }
.hpp-intent__img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; }
.hpp-intent__txt { flex: 1; min-width: 0; }
.hpp-intent__title { display: block; font-weight: 700; font-size: 15px; }
.hpp-intent__sub { display: block; font-size: 12.5px; color: var(--hp-muted); }
.hpp-intent__arrow { color: var(--hp-saffron-ink-2); font-weight: 700; }

.hpp-dismiss {
  margin-top: 12px; border: 0; background: none; padding: 6px 0; color: var(--hp-muted);
  font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: underline;
}
.hpp-dismiss:hover { color: var(--hp-ink); }

/* ==========================================================================
   4. Exit-intent modal
   ========================================================================== */
.hpp-exit { width: min(520px, 100%); border-radius: 24px; }
.hpp-exit__hero { position: relative; height: 150px; overflow: hidden; background: var(--hp-ink); }
.hpp-exit__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.hpp-exit__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 19, 27, .05), rgba(7, 19, 27, .7)); }
.hpp-exit__hero .hpp-close { position: absolute; right: 12px; top: 12px; }
.hpp-exit__badge { position: absolute; left: 22px; bottom: 14px; color: #fff; font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.hpp-exit__body { padding: 20px clamp(18px, 4vw, 26px) 24px; }
.hpp-exit__title { font-family: var(--hp-font-display); font-size: clamp(26px, 4vw, 32px); line-height: 1.05; font-weight: 700; letter-spacing: -.02em; margin: 0 0 8px; }
.hpp-exit__sub { font-size: 15px; line-height: 1.55; color: var(--hp-text-2); margin: 0 0 16px; }
.hpp-exit__submit { width: 100%; }

.hpp-cta-row { display: flex; flex-wrap: wrap; gap: 8px; }
.hpp-cta-row__wa { flex: 1 1 180px; padding: 13px; border-radius: 12px; }
.hpp-cta-row__keep { flex: 1 1 140px; padding: 13px; border-radius: 12px; }
.hpp-trust { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 12.5px; color: var(--hp-muted); }

/* ==========================================================================
   Shared form (landing + exit)
   ========================================================================== */
.hpp-form { display: grid; gap: 8px; }
.hpp-form[data-hpp-form="exit"] { margin-bottom: 12px; }
.hpp-form__row { display: flex; gap: 8px; }
.hpp-input {
  flex: 1; width: 100%; min-width: 0; min-height: 48px; padding: 14px; border-radius: var(--hp-r-input);
  border: 1px solid var(--hp-line-16); font-size: 16px; font-family: inherit; color: var(--hp-ink);
  background: #fff; outline: none; transition: border-color var(--hp-t-fast), box-shadow var(--hp-t-fast);
}
.hpp-input:focus { border-color: var(--hp-saffron); box-shadow: 0 0 0 3px rgba(255, 159, 28, .18); }
.hpp-input.is-error { border-color: var(--hp-danger); }
.hpp-form__send { flex: 0 0 auto; padding: 0 18px; font-size: 14.5px; font-weight: 700; }
.hpp-consent {
  display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; line-height: 1.45;
  color: var(--hp-muted); cursor: pointer;
}
.hpp-consent input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--hp-ink); flex: 0 0 auto; }
.hpp-err { font-size: 12.5px; color: var(--hp-danger); font-weight: 600; }
.hpp-success {
  background: var(--hp-green-tint); color: #0B5A3D; border-radius: 12px; padding: 12px 14px;
  font-size: 14px; font-weight: 600; margin-bottom: 12px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 560px) {
  .hpp-landing { grid-template-columns: 1fr; }
  .hpp-landing__media { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hpp-banner, .hpp-scrim, .hpp-dialog { animation: none !important; }
  .hpp-btn, .hpp-close, .hpp-switch, .hpp-switch__knob, .hpp-intent, .hpp-input { transition: none !important; }
}

/* ==== Responsive audit fixes ==== */
.hpp-close { width: 44px; height: 44px; min-width: 44px; }
.hpp-switch { position: relative; }
.hpp-switch::before { content: ""; position: absolute; inset: -8px 0; } /* expand tap area to >=44px */
