/* ================================================================
   MYROPAY — INTERACTIVE ENHANCEMENT LAYER
   Mega menu · alternating hero · marquee · language switch · micro-fx
   Loaded after main.css — extends the existing design system,
   overrides nothing structural.
   ================================================================ */

:root{
  --biz:        #17A34A;
  --biz-light:  #22C55E;
  --biz-pale:   #E9FBEF;
  --mm-w: 1180px;
}

/* ───────────────────────── Softer, textured wave lines ───────────── */
/* The hero's decorative wave lines were reading as bold, full-bleed
   strokes competing with the copy and phone visual. Two changes:
   1) thinner strokes, lower ceiling opacity
   2) a mask that fades them out through the middle of the section
      (where the headline / device sit) and keeps them visible only
      toward the top, bottom and side margins — a texture, not a layer
      fighting the content. */
.animated-lines{
  mask-image: radial-gradient(ellipse 65% 60% at 50% 46%, transparent 30%, black 92%);
  -webkit-mask-image: radial-gradient(ellipse 65% 60% at 50% 46%, transparent 30%, black 92%);
}
.line-path{ stroke-width: 1 !important; }
.line-path:nth-child(1){ opacity: 0.05 !important; }
.line-path:nth-child(2){ opacity: 0.035 !important; }
.line-path:nth-child(3){ opacity: 0.045 !important; }
.line-path:nth-child(4){ opacity: 0.03 !important; }

/* ───────────────────────── Logo icon ─────────────────────────────── */
/* icon.svg is pure white artwork (no background shape), designed to sit
   on the brand-purple app icon tile — so it needs a colored badge behind
   it wherever the surrounding background isn't already purple/dark. */
.nav-logo{ display:inline-flex; align-items:center; gap:3px; }
.nav-logo img{
  flex-shrink:0; width:26px; height:26px; padding:5px; box-sizing:border-box;
  background: linear-gradient(135deg,#7C3AED,#8B5CF6); border-radius:8px;
}
.footer-logo{ display:flex; align-items:center; gap:3px; }
.footer-logo img{
  flex-shrink:0; width:24px; height:24px; padding:4px; box-sizing:border-box;
  background: linear-gradient(135deg,#7C3AED,#8B5CF6); border-radius:7px;
}

/* Faint oversized watermark of the same mark, used inside CTA sections
   (see .cta-logo-mark below) — there the purple gradient background
   already gives the white artwork contrast, so no badge is needed. */

/* ───────────────────────── CTA section texture ───────────────────── */
.cta-logo-mark{
  position:absolute; z-index:0; pointer-events:none;
  width:560px; height:560px; opacity:.07;
  right:-140px; bottom:-160px; transform: rotate(-10deg);
}
@media (max-width:700px){
  .cta-logo-mark{ width:300px; height:300px; right:-70px; bottom:-90px; }
}

/* ───────────────────────── NAV / MEGA MENU ───────────────────────── */
.nav-inner{ position: relative; }

.nav-links{ position: relative; }

.mega{ position: static; }
.mega > .nav-link{
  display:flex; align-items:center; gap:6px; cursor:pointer;
  background:none; border:none; font-family:inherit;
}
.mega > .nav-link .chev{ transition: transform var(--t2) var(--ease-out); }
.mega.open > .nav-link .chev{ transform: rotate(180deg); }
.mega.open > .nav-link{ color: var(--gray-9); background: var(--bg-soft); }

.mega-panel{
  position:absolute; left:50%; top:calc(100% + 12px);
  transform: translate(-50%, -10px) scale(.98);
  width: min(var(--mm-w), calc(100vw - 32px));
  background: var(--white);
  border:1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-xl);
  padding: 28px;
  display:grid; grid-template-columns: 1.5fr 1fr; gap: 32px;
  opacity:0; visibility:hidden; pointer-events:none;
  transition: opacity .22s var(--ease-out), transform .22s var(--ease-out), visibility .22s;
  z-index: 200;
}
.mega.open .mega-panel{
  opacity:1; visibility:visible; pointer-events:auto;
  transform: translate(-50%, 0) scale(1);
}
.mega-col-title{
  font-size:11px; font-weight:800; letter-spacing:.1em; text-transform:uppercase;
  color: var(--gray-4); margin-bottom:14px; padding-left:12px;
}
.mega-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.mega-item{
  display:flex; align-items:flex-start; gap:12px;
  padding:12px; border-radius: var(--r-lg);
  transition: background var(--t1), transform var(--t1);
  opacity:0; transform: translateY(6px);
}
.mega.open .mega-item{ animation: megaItemIn .38s var(--ease-out) forwards; }
.mega.open .mega-item:nth-child(1){ animation-delay: .02s; }
.mega.open .mega-item:nth-child(2){ animation-delay: .05s; }
.mega.open .mega-item:nth-child(3){ animation-delay: .08s; }
.mega.open .mega-item:nth-child(4){ animation-delay: .11s; }
.mega.open .mega-item:nth-child(5){ animation-delay: .14s; }
.mega.open .mega-item:nth-child(6){ animation-delay: .17s; }
.mega.open .mega-item:nth-child(7){ animation-delay: .20s; }
.mega.open .mega-item:nth-child(8){ animation-delay: .23s; }
@keyframes megaItemIn{ to{ opacity:1; transform:none; } }
.mega-item:hover{ background: var(--bg-soft); }
.mega-item:hover .mega-item-icon{ transform: scale(1.08) rotate(-4deg); }
.mega-item-icon{
  width:36px; height:36px; border-radius:11px; flex-shrink:0;
  background: var(--bg-soft); display:flex; align-items:center; justify-content:center;
  transition: transform var(--t2) var(--ease-spring);
}
.mega-item-icon img{ width:18px; height:18px; object-fit:contain; }
.mega-item-title{ font-size:13.5px; font-weight:700; color:var(--gray-8); margin-bottom:2px; }
.mega-item-sub{ font-size:11.5px; color:var(--gray-4); line-height:1.4; }
.mega[data-flavor="business"] .mega-item-icon{ background: var(--biz-pale); }
.mega[data-flavor="business"] .mega-item:hover{ background: var(--biz-pale); }

.mega-promo{
  border-radius: var(--r-xl);
  background: linear-gradient(160deg, var(--bg-soft), var(--white));
  border:1px solid var(--border-s);
  padding: 20px; display:flex; flex-direction:column; gap:14px;
  position:relative; overflow:hidden;
}
.mega[data-flavor="business"] .mega-promo{ background: linear-gradient(160deg, var(--biz-pale), var(--white)); }
.mega-promo-shot{
  border-radius: 14px; overflow:hidden; box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,.05); height:150px; position:relative;
}
.mega-promo-shot img{ width:100%; height:100%; object-fit:cover; object-position: top center; }
.mega-promo h4{ font-family:var(--font-display); font-size:16px; font-weight:800; color:var(--gray-9); }
.mega-promo p{ font-size:12.5px; color:var(--gray-5); line-height:1.5; }
.mega-promo .btn{ align-self:flex-start; }

/* Dim rest of page while a mega menu is open */
.mega-scrim{
  position:fixed; inset:0; top:64px; background: rgba(10,6,20,.18);
  backdrop-filter: blur(2px); opacity:0; visibility:hidden;
  transition: opacity .22s var(--ease-out), visibility .22s;
  z-index:150; pointer-events:none;
}
.mega-scrim.show{ opacity:1; visibility:visible; pointer-events:auto; }

/* Sliding active-link indicator */
.nav-indicator{
  position:absolute; bottom:2px; height:2px; border-radius:2px;
  background: var(--brand); opacity:0; transition: all .28s var(--ease-spring);
  pointer-events:none;
}
.nav-links:hover .nav-indicator{ opacity:1; }

/* Dev link badge */
.nav-link-dev{ display:flex; align-items:center; gap:6px; }
.nav-link-dev .tag{
  font-family: var(--font-mono); font-size:9.5px; font-weight:700;
  background: var(--gray-9); color:white; padding:1px 5px; border-radius:5px;
  letter-spacing:.02em;
}

/* Language switcher */
.lang-switch{ position:relative; }
.lang-btn{
  display:flex; align-items:center; gap:6px; font-size:13px; font-weight:600;
  color: var(--gray-6); padding:7px 10px; border-radius: var(--r-md);
  border:1px solid transparent; transition: all var(--t1);
}
.lang-btn:hover{ background: var(--bg-soft); color:var(--gray-9); }
.lang-btn svg{ flex-shrink:0; }
.lang-menu{
  position:absolute; right:0; top:calc(100% + 8px);
  background:white; border:1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); min-width:172px; padding:6px;
  opacity:0; visibility:hidden; transform: translateY(-6px);
  transition: all .18s var(--ease-out); z-index:200;
}
.lang-switch.open .lang-menu{ opacity:1; visibility:visible; transform:none; }
.lang-option{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  width:100%; text-align:left; padding:9px 10px; border-radius: var(--r-md);
  font-size:13px; font-weight:500; color:var(--gray-7);
}
.lang-option:hover{ background:var(--bg-soft); color:var(--brand); }
.lang-option.active{ color:var(--brand); font-weight:700; }
.lang-option .code{ font-family:var(--font-mono); font-size:10.5px; color:var(--gray-4); }

@media (max-width: 900px){
  .mega-panel{ display:none !important; }
  .lang-switch{ display:none; }
}

/* ───────────────────────── HERO MODE TOGGLE ───────────────────────── */
.hero-modeswitch{
  display:inline-flex; padding:4px; background: var(--bg-soft);
  border:1px solid var(--border); border-radius: var(--r-full);
  margin-bottom: 24px; gap:2px; position:relative;
}
.hero-modeswitch button{
  position:relative; z-index:1; padding:9px 20px; border-radius: var(--r-full);
  font-size:13.5px; font-weight:700; color: var(--gray-5);
  display:flex; align-items:center; gap:7px; transition: color var(--t2);
}
.hero-modeswitch button.active{ color:white; }
.hero-modeswitch .pill{
  position:absolute; top:4px; left:4px; height:calc(100% - 8px);
  border-radius: var(--r-full); background: var(--brand);
  transition: all .38s var(--ease-spring); z-index:0;
  box-shadow: 0 4px 16px rgba(124,58,237,.35);
}
.hero-modeswitch[data-mode="business"] .pill{ background: var(--biz); box-shadow: 0 4px 16px rgba(23,163,74,.35); }

/* Copy blocks crossfade */
.hero-copy-mode{
  display:grid; grid-template-areas:"stack";
}
.hero-copy-mode > *{ grid-area: stack; }
.hero-mode-panel{
  opacity:0; transform: translateY(8px); pointer-events:none;
  transition: opacity .32s var(--ease-out), transform .32s var(--ease-out);
}
.hero-mode-panel.active{ opacity:1; transform:none; pointer-events:auto; }

.gradient-text.mode-business{
  background: linear-gradient(90deg, var(--biz), #4ADE80);
  -webkit-background-clip:text; background-clip:text; color:transparent;
}

/* ───────────────────────── DEVICE FRAME (real screenshots) ───────── */
.device-stage{ position:relative; width:272px; height:560px; flex-shrink:0; }
.device-frame{
  position:absolute; inset:0; border-radius:46px; padding:10px;
  background: linear-gradient(160deg, #1a1a1a, #060606);
  box-shadow:
    0 40px 90px -20px rgba(124,58,237,.30),
    0 0 0 1px rgba(255,255,255,.06) inset,
    0 2px 0 rgba(255,255,255,.08) inset;
  transition: box-shadow .4s var(--ease-out);
}
[data-mode="business"] .device-frame{ box-shadow: 0 40px 90px -20px rgba(23,163,74,.32), 0 0 0 1px rgba(255,255,255,.06) inset, 0 2px 0 rgba(255,255,255,.08) inset; }
.device-frame::before{
  content:''; position:absolute; right:-2px; top:120px; width:3px; height:56px;
  background:#0a0a0a; border-radius:2px 0 0 2px;
}
.device-frame::after{
  content:''; position:absolute; left:-2px; top:96px; width:3px; height:32px;
  background:#0a0a0a; border-radius:0 2px 2px 0; box-shadow: 0 44px 0 #0a0a0a, 0 84px 0 #0a0a0a;
}
.device-screen{
  position:relative; width:100%; height:100%; border-radius:36px;
  overflow:hidden; background:#000;
}
.device-shot{
  position:absolute; inset:0; width:100%; height:100%;
  object-fit:cover; object-position: top center;
  opacity:0; transform: scale(1.04);
  transition: opacity .5s var(--ease-out), transform .6s var(--ease-out);
}
.device-shot.active{ opacity:1; transform: scale(1); }

.device-stage:hover .device-frame{ transform: perspective(900px) rotateY(-4deg) rotateX(2deg); }
.device-frame{ transform: perspective(900px) rotateY(0) rotateX(0); transition: transform .5s var(--ease-out), box-shadow .4s var(--ease-out); }

.float-card{ transition: opacity .3s var(--ease-out), transform .3s var(--ease-out); }
.float-card.fc-hide{ opacity:0; transform: scale(.9) translateY(4px); pointer-events:none; }

@media (max-width:900px){
  .device-stage{ width:220px; height:452px; }
}

/* ───────────────────────── MARQUEE (trust logos) ───────────────── */
.marquee{ overflow:hidden; position:relative; padding: 16px 0; }
.marquee::before, .marquee::after{
  content:''; position:absolute; top:0; bottom:0; width:80px; z-index:2; pointer-events:none;
}
.marquee::before{ left:0; background: linear-gradient(90deg, var(--bg), transparent); }
.marquee::after{ right:0; background: linear-gradient(270deg, var(--bg), transparent); }
.marquee-track{
  display:flex; align-items:center; gap:56px; width:max-content; height:48px;
  animation: marqueeScroll 26s linear infinite;
}
.marquee:hover .marquee-track{ animation-play-state: paused; }
@keyframes marqueeScroll{ from{ transform:translateX(0); } to{ transform:translateX(-50%); } }
.marquee-track .integration-logo{
  opacity:.5; filter:grayscale(1); transition: opacity var(--t2), filter var(--t2);
  display:flex; align-items:center; height:100%; flex-shrink:0;
}
.marquee-track .integration-logo img{ max-height:40px; width:auto; object-fit:contain; display:block; }
.marquee-track .integration-logo:hover{ opacity:1; filter:grayscale(0); }

/* ───────────────────────── Magnetic buttons ─────────────────────── */
.btn-magnetic{ will-change: transform; }

/* ───────────────────────── Expandable feature cards ─────────────── */
.card-feature{ position:relative; cursor:default; }
.card-feature-expand{
  position:absolute; top:20px; right:20px; width:28px; height:28px;
  border-radius: var(--r-full); background: var(--bg-soft); color: var(--gray-5);
  display:flex; align-items:center; justify-content:center;
  transition: all var(--t2) var(--ease-out);
}
.card-feature-expand svg{ transition: transform var(--t2) var(--ease-out); }
.card-feature.is-open .card-feature-expand{ background: var(--brand); color:white; }
.card-feature.is-open .card-feature-expand svg{ transform: rotate(180deg); }
.card-feature-detail{
  max-height:0; overflow:hidden; opacity:0;
  transition: max-height .32s var(--ease-out), opacity .28s var(--ease-out), margin-top .32s;
  font-size:13px; color:var(--gray-6); line-height:1.6;
}
.card-feature.is-open .card-feature-detail{ max-height:200px; opacity:1; margin-top:14px; }
.card-feature-detail ul{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:6px; }
.card-feature-detail li{ display:flex; align-items:flex-start; gap:8px; }
.card-feature-detail li::before{ content:'✓'; color: var(--brand); font-weight:800; flex-shrink:0; }

/* ───────────────────────── Live FX calculator ────────────────────── */
.fx-calc{
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  background: var(--white); border:1px solid var(--border);
  border-radius: var(--r-2xl); box-shadow: var(--shadow-md);
  padding: 18px 22px; max-width: 900px; margin: 0 auto;
}
.fx-field{ display:flex; flex-direction:column; gap:4px; }
.fx-field label{ font-size:10.5px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--gray-4); }
.fx-amount-wrap{ display:flex; align-items:center; gap:8px; }
.fx-calc input[type="number"]{
  width:130px; border:1.5px solid var(--border); border-radius: var(--r-md);
  padding:9px 12px; font-family:var(--font-mono); font-size:15px; font-weight:700; color:var(--gray-9);
}
.fx-calc select{
  border:1.5px solid var(--border); border-radius: var(--r-md);
  padding:9px 10px; font-size:14px; font-weight:700; color:var(--gray-8); background:white;
}
.fx-calc input:focus, .fx-calc select:focus{ outline:none; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-pale); }
.fx-swap-btn{
  width:34px; height:34px; border-radius:var(--r-full); background:var(--bg-soft);
  display:flex; align-items:center; justify-content:center; color:var(--gray-6);
  transition: all var(--t2); flex-shrink:0; margin-top:16px;
}
.fx-swap-btn:hover{ background:var(--brand); color:white; transform:rotate(180deg); }
.fx-result-wrap{ flex:1; min-width:200px; }
.fx-result{ font-family:var(--font-display); font-size:22px; font-weight:800; color:var(--gray-9); }
.fx-rate-note{ font-size:11.5px; color:var(--gray-4); margin-top:2px; }
@media (max-width: 700px){
  .fx-calc{ flex-direction:column; align-items:stretch; }
  .fx-swap-btn{ align-self:center; margin:0; transform:rotate(90deg); }
  .fx-swap-btn:hover{ transform:rotate(270deg); }
}

/* ───────────────────────── Cookie preferences modal ──────────────── */
.cookie-close{
  position:absolute; top:14px; right:14px; width:26px; height:26px;
  border-radius:var(--r-full); display:flex; align-items:center; justify-content:center;
  color:var(--gray-4); font-size:18px; line-height:1; transition: all var(--t2);
}
.cookie-close:hover{ background:var(--bg-soft); color:var(--gray-8); }

.cookie-modal-overlay{
  position:fixed; inset:0; background:rgba(10,6,20,.45); backdrop-filter: blur(3px);
  z-index:2000; display:flex; align-items:center; justify-content:center; padding:20px;
  opacity:0; visibility:hidden; transition: opacity .22s ease, visibility .22s;
}
.cookie-modal-overlay.show{ opacity:1; visibility:visible; }
.cookie-modal{
  background:white; border-radius:var(--r-2xl); box-shadow:var(--shadow-xl);
  max-width:480px; width:100%; max-height:85vh; overflow-y:auto; padding:28px;
  transform: translateY(12px) scale(.98); transition: transform .25s var(--ease-out);
}
.cookie-modal-overlay.show .cookie-modal{ transform:none; }
.cookie-modal-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:8px; }
.cookie-modal-head h3{ font-family:var(--font-display); font-size:19px; font-weight:800; color:var(--gray-9); }
.cookie-modal-close{
  width:28px; height:28px; border-radius:var(--r-full); flex-shrink:0;
  display:flex; align-items:center; justify-content:center; color:var(--gray-4); font-size:18px;
  transition: all var(--t2);
}
.cookie-modal-close:hover{ background:var(--bg-soft); color:var(--gray-8); }
.cookie-modal-intro{ font-size:13.5px; color:var(--gray-5); line-height:1.6; margin-bottom:20px; }
.cookie-pref-row{
  display:flex; align-items:flex-start; justify-content:space-between; gap:16px;
  padding:14px 0; border-top:1px solid var(--border);
}
.cookie-pref-title{ font-size:14px; font-weight:700; color:var(--gray-8); margin-bottom:3px; }
.cookie-pref-sub{ font-size:12.5px; color:var(--gray-4); line-height:1.5; }

.toggle-switch{ position:relative; display:inline-block; width:42px; height:24px; flex-shrink:0; }
.toggle-switch input{ opacity:0; width:0; height:0; }
.toggle-slider{
  position:absolute; inset:0; background:var(--gray-2); border-radius:var(--r-full);
  cursor:pointer; transition: background var(--t2);
}
.toggle-slider::before{
  content:''; position:absolute; width:18px; height:18px; left:3px; top:3px;
  background:white; border-radius:50%; transition: transform var(--t2);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.toggle-switch input:checked + .toggle-slider{ background: var(--brand); }
.toggle-switch input:checked + .toggle-slider::before{ transform: translateX(18px); }
.toggle-switch.is-locked .toggle-slider{ cursor:default; opacity:.7; }

.cookie-modal-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:22px; padding-top:18px; border-top:1px solid var(--border); }

/* ───────────────────────── Send-money demo card ──────────────────── */
.send-demo-fade{ transition: opacity .22s ease; }
.send-demo-fade.is-swapping{ opacity: .12; }

/* ───────────────────────── i18n fade on switch ──────────────────── */
[data-i18n]{ transition: opacity .18s ease; }
.i18n-fading{ opacity:.2; }
