/* ==========================================================================
   WVP mFunds announcement popup

   Fires on the header "Најави се" click, before the redirect to the investor
   portal. Built from the theme's own tokens (--hp-*) with fallbacks, because
   this loads site-wide while homepage.css does not.
   ========================================================================== */

.wvp-app-popup {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: var(--hp-font, 'Source Sans 3', 'Roboto', sans-serif);
}

.wvp-app-popup.is-open {
  display: flex;
  animation: wvpAppPopupFade 0.25s ease;
}

.wvp-app-popup.is-open .wvp-app-popup__dialog {
  animation: wvpAppPopupRise 0.32s cubic-bezier(0.2, 0.8, 0.3, 1);
}

@keyframes wvpAppPopupFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes wvpAppPopupRise {
  from { transform: translateY(14px) scale(0.985); }
  to   { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .wvp-app-popup.is-open,
  .wvp-app-popup.is-open .wvp-app-popup__dialog { animation: none; }
}

body.wvp-app-popup-open { overflow: hidden; }

.wvp-app-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 47, 63, 0.6);
}

.wvp-app-popup__dialog {
  position: relative;
  width: 100%;
  max-width: 800px;
  overflow: hidden;
  background: var(--hp-white, #fff);
  /* Deliberately larger than --hp-radius-card: that token is for inline cards,
     this is a full modal and 8px reads mean at 800px wide. */
  border-radius: 16px;
  box-shadow:
    0 2px 3px rgba(20, 35, 48, 0.10),
    0 12px 28px rgba(20, 35, 48, 0.20),
    0 36px 80px rgba(20, 35, 48, 0.34);
}

/* Faint WVP watermark. Real text, so it renders in the site font — an SVG used
   as a background is isolated from the page and cannot load the webfont. */
.wvp-app-popup__watermark {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.wvp-app-popup__watermark-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  width: 170%;
  margin: -18% 0 0 -16%;
  transform: rotate(-18deg);
  font-size: 152px;
  font-style: italic;
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.06em;
  /* Outline only — hollow letters read as a pattern instead of grey blocks. */
  color: transparent;
  -webkit-text-stroke: 1.2px #E6F0F4;
}

/* Same mark inside the phone screen, knocked back over the red. */
.wvp-app-popup__phone-screen .wvp-app-popup__watermark-grid {
  gap: 0 6px;
  font-size: 92px;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.20);
}

.wvp-app-popup__close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--hp-white, #fff);
  color: var(--hp-navy, #1f2f3f);
  border: 1px solid var(--hp-gray-border, #E0E0E0);
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wvp-app-popup__close:hover {
  background: var(--hp-red, #cd2c2a);
  color: var(--hp-white, #fff);
  border-color: var(--hp-red, #cd2c2a);
}

/* ---- Headline ------------------------------------------------------------ */

.wvp-app-popup__title {
  position: relative;
  z-index: 2;
  margin: 0;
  max-width: 520px;
  margin: 0 auto;
  padding: 46px 20px 8px;
  text-align: center;
}

.wvp-app-popup__title-lead,
.wvp-app-popup__title-main {
  display: block;
  /* Keeps the two-line break of the creative without hard-coding <br> per language. */
  text-wrap: balance;
}

.wvp-app-popup__title-lead {
  color: var(--hp-navy, #1f2f3f);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.28;
}

.wvp-app-popup__title-main {
  margin-top: 10px;
  color: var(--hp-red, #cd2c2a);
  font-size: 38px;
  font-weight: 700;
  line-height: 1.2;
}

/* ---- Body ---------------------------------------------------------------- */

.wvp-app-popup__body {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 330px 1fr;
  align-items: end;
  padding-top: 8px;
}

/* ---- Phone mock-up (pure CSS) -------------------------------------------- */

.wvp-app-popup__phone {
  position: relative;
  z-index: 2;
  width: 286px;
  margin: 0 0 -22px 36px;
  padding: 9px 9px 0;
  /* Brushed-metal edge: light catches the left rail, right rail falls away. */
  background: linear-gradient(105deg, #101923 0%, #34495b 8%, #172532 22%, #0d151d 78%, #293c4d 94%, #0b1218 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 42px 42px 18px 18px;
  box-shadow:
    0 28px 38px rgba(15, 27, 38, 0.30),
    0 10px 14px rgba(15, 27, 38, 0.20),
    inset 1px 0 0 rgba(255, 255, 255, 0.28),
    inset -1px 0 0 rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* Volume rocker and power button. */
.wvp-app-popup__phone::before {
  content: "";
  position: absolute;
  top: 92px;
  left: -5px;
  width: 4px;
  height: 64px;
  border-radius: 3px 0 0 3px;
  /* One continuous rocker. Segmenting it needs transparent gaps, and these sit
     outside the phone body, so the gaps showed the white dialog through. */
  background: #172532;
  box-shadow: -1px 0 2px rgba(0, 0, 0, 0.3);
}

.wvp-app-popup__phone::after {
  content: "";
  position: absolute;
  top: 128px;
  right: -4px;
  width: 4px;
  height: 40px;
  border-radius: 0 3px 3px 0;
  background: #172532;
  box-shadow: 1px 0 2px rgba(0, 0, 0, 0.3);
}

.wvp-app-popup__phone-screen {
  position: relative;
  height: 392px;
  padding: 44px 22px 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 6%, rgba(255, 255, 255, 0.14), transparent 34%),
    linear-gradient(145deg, #df3835 0%, var(--hp-red, #cd2c2a) 46%, #ad1f1e 100%);
  border: 1px solid rgba(0, 0, 0, 0.62);
  border-radius: 34px 34px 10px 10px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.10),
    inset 0 5px 12px rgba(0, 0, 0, 0.28),
    inset 5px 0 12px rgba(0, 0, 0, 0.14),
    inset -5px 0 12px rgba(0, 0, 0, 0.20);
}

.wvp-app-popup__phone-notch {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 88px;
  height: 19px;
  background: linear-gradient(180deg, #070b0f, #182631);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 0 12px 12px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.45),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

.wvp-app-popup__phone-logo {
  position: relative;
  display: block;
  width: 168px;
  height: auto;
  margin: 66px auto 0;
  /* The site logo is dark; force it white for the red app screen. */
  filter: brightness(0) invert(1);
}

.wvp-app-popup__phone-form {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 34px;
  z-index: 2;
  color: var(--hp-white, #fff);
}

.wvp-app-popup__phone-hello {
  display: block;
  font-size: 12px;
  opacity: 0.85;
}

.wvp-app-popup__phone-title {
  display: block;
  margin-bottom: 20px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.wvp-app-popup__phone-label {
  display: block;
  margin-bottom: 6px;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.wvp-app-popup__phone-input {
  display: block;
  padding: 13px 15px;
  background: linear-gradient(180deg, #fff 0%, #f3f5f6 100%);
  border: 1px solid rgba(19, 35, 48, 0.14);
  border-radius: 10px;
  color: var(--hp-gray, #666);
  font-size: 14px;
  box-shadow:
    inset 0 2px 5px rgba(31, 47, 63, 0.12),
    0 -1px 0 rgba(255, 255, 255, 0.35);
}

/* ---- Message panel ------------------------------------------------------- */

.wvp-app-popup__panel {
  position: relative;
  z-index: 1;
  margin: 0 44px 0 -34px;
  padding-bottom: 30px;
}

.wvp-app-popup__note {
  position: relative;
  padding: 28px 30px 32px 52px;
  background: linear-gradient(145deg, #dc3734 0%, var(--hp-red, #cd2c2a) 52%, #b32220 100%);
  color: var(--hp-white, #fff);
  border-top: 1px solid rgba(255, 255, 255, 0.20);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 30px), calc(100% - 30px) 100%, 0 100%);
  /* box-shadow ignores the clipped corner and draws the uncut rectangle —
     drop-shadow follows the real silhouette. */
  filter:
    drop-shadow(0 3px 2px rgba(95, 15, 15, 0.18))
    drop-shadow(0 12px 14px rgba(69, 24, 24, 0.24));
}

.wvp-app-popup__note p {
  margin: 0 0 15px;
  font-size: 17px;
  line-height: 1.5;
}

.wvp-app-popup__note p:last-child { margin-bottom: 0; }

.wvp-app-popup__note a,
.wvp-app-popup__note a:visited {
  color: var(--hp-white, #fff);
  font-weight: 700;
  text-decoration: underline;
}

.wvp-app-popup__stores {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 20px 0 0 52px;
}

.wvp-app-popup__store {
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  width: 168px;
  height: 52px;
  padding: 0 14px;
  background: linear-gradient(180deg, #253748 0%, var(--hp-navy, #1f2f3f) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  color: var(--hp-white, #fff);
  text-decoration: none;
  box-shadow:
    0 2px 3px rgba(20, 35, 48, 0.16),
    0 6px 14px rgba(20, 35, 48, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.wvp-app-popup__store:visited { color: var(--hp-white, #fff); }

.wvp-app-popup__store:hover,
.wvp-app-popup__store:focus {
  transform: translateY(-2px);
  color: var(--hp-white, #fff);
  text-decoration: none;
  box-shadow:
    0 3px 5px rgba(20, 35, 48, 0.18),
    0 12px 22px rgba(20, 35, 48, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.wvp-app-popup__store-glyph {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
}

.wvp-app-popup__store-label {
  display: block;
  line-height: 1.15;
}

.wvp-app-popup__store-lead {
  display: block;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.8;
}

.wvp-app-popup__store-name {
  display: block;
  font-size: 17px;
  font-weight: 600;
}

.wvp-app-popup__continue,
.wvp-app-popup__continue:visited {
  display: inline-block;
  margin: 14px 0 0 52px;
  color: var(--hp-navy, #1f2f3f);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.wvp-app-popup__continue::after {
  content: " \2192";
  display: inline-block;
  transition: transform 0.18s ease;
}

.wvp-app-popup__continue:hover,
.wvp-app-popup__continue:focus {
  color: var(--hp-red, #cd2c2a);
  text-decoration: none;
}

.wvp-app-popup__continue:hover::after { transform: translateX(3px); }

/* ---- Mobile ---------------------------------------------------------------
   Different structure, not the desktop layout squeezed: the headline becomes a
   red header band, the message sits on white underneath, and the two store
   buttons go full-width. The phone mock-up is dropped — at 360px it would eat
   the half of the card the message needs.
   -------------------------------------------------------------------------- */

@media (max-width: 720px) {
  .wvp-app-popup { padding: 12px; }

  .wvp-app-popup__dialog {
    max-width: 360px;
    border-radius: 14px;
  }

  /* Watermark belongs to the red header on mobile, not the whole card. */
  .wvp-app-popup__dialog > .wvp-app-popup__watermark { display: none; }

  .wvp-app-popup__close {
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.45);
    color: var(--hp-white, #fff);
  }

  .wvp-app-popup__title {
    position: relative;
    overflow: hidden;
    max-width: none;
    margin: 0;
    padding: 34px 26px 30px;
    background:
      radial-gradient(circle at 22% 8%, rgba(255, 255, 255, 0.16), transparent 42%),
      linear-gradient(145deg, #dc3734 0%, var(--hp-red, #cd2c2a) 52%, #b32220 100%);
    text-align: left;
  }

  /* Hollow WVP pattern, knocked back over the red. */
  .wvp-app-popup__title::before {
    content: "WVP WVP WVP WVP WVP WVP";
    position: absolute;
    top: -18px;
    left: -12px;
    width: 150%;
    color: transparent;
    -webkit-text-stroke: 1.2px rgba(255, 255, 255, 0.22);
    font-size: 96px;
    font-style: italic;
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.06em;
    transform: rotate(-18deg);
    pointer-events: none;
  }

  .wvp-app-popup__title-lead,
  .wvp-app-popup__title-main {
    position: relative;
    color: var(--hp-white, #fff);
    text-wrap: pretty;
  }

  .wvp-app-popup__title-lead {
    font-size: 17px;
    opacity: 0.9;
  }

  .wvp-app-popup__title-main {
    margin-top: 6px;
    font-size: 26px;
  }

  .wvp-app-popup__body {
    display: block;
    padding-top: 0;
  }

  .wvp-app-popup__phone { display: none; }

  .wvp-app-popup__panel {
    margin: 0;
    padding-bottom: 24px;
  }

  /* On white, the message is dark text — the red now lives in the header. */
  .wvp-app-popup__note {
    padding: 24px 26px 4px;
    background: none;
    border-top: 0;
    clip-path: none;
    filter: none;
    color: var(--hp-navy, #1f2f3f);
  }

  .wvp-app-popup__note p {
    margin-bottom: 12px;
    font-size: 15px;
  }

  .wvp-app-popup__note a { color: var(--hp-red, #cd2c2a); }

  .wvp-app-popup__stores {
    display: block;
    padding: 16px 26px 0;
  }

  .wvp-app-popup__store {
    width: 100%;
    height: 56px;
  }

  .wvp-app-popup__store + .wvp-app-popup__store { margin-top: 10px; }

  .wvp-app-popup__continue {
    display: block;
    margin: 18px 26px 0;
    text-align: center;
  }
}

/* ---- Short viewports: compact rather than scroll ------------------------- */

@media (min-width: 721px) and (max-height: 760px) {
  .wvp-app-popup__title { padding: 30px 20px 4px; }

  .wvp-app-popup__title-lead { font-size: 23px; }

  .wvp-app-popup__title-main { font-size: 31px; }

  .wvp-app-popup__phone { width: 250px; }

  .wvp-app-popup__phone-screen { height: 320px; }

  .wvp-app-popup__phone-logo { width: 140px; margin-top: 46px; }

  .wvp-app-popup__phone-title { font-size: 21px; margin-bottom: 14px; }

  .wvp-app-popup__body { grid-template-columns: 300px 1fr; }

  .wvp-app-popup__note { padding: 22px 30px 26px 60px; }

  .wvp-app-popup__note p { font-size: 15px; margin-bottom: 14px; }

  .wvp-app-popup__stores { padding-top: 16px; }

  .wvp-app-popup__stores img { height: 38px; }
}
