/* PuzzleMania UAE — base + layout (mobile-first). Theme tokens live in config.css */

*, *::before, *::after { box-sizing: border-box; }
/* no overflow-x on html/body: it breaks the viewport width when the window is resized (Chrome device mode / rotation) */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--c-page); color: var(--c-ink);
  font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
body.rtl-text { font-family: var(--font-ar); }
body.noscroll { overflow: hidden; }
h1, h2, h3, p, ul { margin: 0; }
/* long words / e-mails never push the layout wider than the screen */
h1, h2, h3, p, li, label, a, span { overflow-wrap: break-word; }
.how > *, .incl li, .perks__list li, .faq__btn > span, .fld > *, .header > * { min-width: 0; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; }
a { color: var(--c-brand); }
a:hover { color: var(--c-brand-dark); }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { width: 100%; max-width: var(--col); margin: 0 auto; padding: 0 12px; }
.wrap--wide { max-width: var(--col-wide); }

/* ================= TOP LINE + HEADER ================= */
.topline { padding: 8px 14px; text-align: center; font-size: 13px; font-weight: 500; color: var(--c-ink-2); border-bottom: 1px solid var(--c-line-warm); }
.header { display: grid; grid-template-columns: minmax(44px, 1fr) auto minmax(0, 1fr); column-gap: 8px; align-items: center; padding: 8px 14px; max-width: var(--col-wide); margin: 0 auto; }
.menu-btn { justify-self: start; width: 44px; height: 44px; border: 0; background: transparent; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 10px; }
.menu-btn svg { width: 34px; height: 26px; }
.brand { justify-self: center; font: 500 19px/1 var(--font-brand); color: var(--c-ink); text-decoration: none; }
.brand:hover { color: var(--c-ink); }
.langs { justify-self: end; display: flex; align-items: center; gap: 2px; font-size: 16px; font-weight: 500; }
.lang { border: 0; background: transparent; padding: 10px 4px; min-width: 32px; cursor: pointer; font: inherit; font-family: var(--font); color: var(--c-ink); border-radius: 6px; }
.lang.active { font-weight: 800; color: var(--c-brand); }

/* menu popup */
.popup { position: fixed; inset: 0; z-index: 100; overflow: hidden; background: rgba(16, 70, 90, .45); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease; }
.popup.open { opacity: 1; visibility: visible; }
.popup__panel {
  position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(320px, 86vw); background: var(--c-page);
  padding: 12px 20px 24px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto;
  transform: translateX(-100%); transition: transform .25s ease;
}
body.rtl-text .popup__panel { transform: translateX(100%); }
.popup.open .popup__panel { transform: translateX(0); }
.popup__close { align-self: flex-start; width: 44px; height: 44px; margin-inline-start: -8px; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--c-brand); border-radius: 10px; }
.popup__close svg { width: 22px; height: 22px; }
.popup__brand { font: 500 22px/1 var(--font-brand); color: var(--c-ink); margin: 4px 0 12px; }
.menu { list-style: none; padding: 0; }
.menu li { border-bottom: 1px solid var(--c-line); }
.menu a { display: flex; align-items: center; min-height: 52px; font-size: 17px; font-weight: 700; color: var(--c-brand); text-decoration: none; }

/* ================= INTRO + FORM CARD ================= */
.intro { padding: 0 18px; text-align: center; font-size: 13.5px; line-height: 1.4; color: var(--c-ink-2); max-width: var(--col); margin: 0 auto; }

.card {
  margin: 12px 12px 0; padding: 14px 14px 16px; border-radius: 24px; background: var(--c-card);
  box-shadow: 0 14px 30px rgba(16, 70, 90, .22); display: flex; flex-direction: column; gap: 12px;
}
.card__label { font-size: 25px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; text-align: center; color: #FFFFFF; }

.card__label--pin { font-size: 34px; letter-spacing: -0.01em; }

/* banner v1: original tiles picture */
.banner { height: 150px; border-radius: 18px; background: var(--c-banner); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.banner img { width: 214px; height: 140px; object-fit: contain; }

/* phone / PIN field */
.field-wrap { display: flex; flex-direction: column; gap: 7px; }
.fld {
  position: relative; display: flex; align-items: center; gap: 10px; height: 66px; padding: 0 8px;
  border: 2.5px solid var(--c-brand); border-radius: 18px; background: #FFFFFF; transition: border-color .15s, box-shadow .15s;
  direction: ltr;
}
.fld.idle { animation: ring 2.4s ease-out infinite; }
.fld:focus-within { animation: none; border-color: var(--c-brand); box-shadow: 0 0 0 5px rgba(16, 70, 90, .16); }
.fld.ok { animation: none; border-color: var(--c-ok); box-shadow: 0 0 0 5px rgba(35, 148, 95, .16); }
.fld.err { animation: shake .4s; border-color: var(--c-err); box-shadow: 0 0 0 5px rgba(200, 55, 45, .16); }
.cc {
  flex: none; display: flex; align-items: center; gap: 7px; height: 48px; padding: 0 11px; border-radius: 12px;
  background: var(--c-cc); font: 700 20px/1 var(--font); color: var(--c-brand);
}
.cc svg { width: 26px; height: 26px; flex: none; }
.num {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; padding: 0;
  font: 700 23px/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: .03em; color: var(--c-brand); direction: ltr; text-align: left;
}
.num::placeholder { color: #93A6A8; font-weight: 500; letter-spacing: 0; font-size: 19px; opacity: 1; }
.num--pin { text-align: center; letter-spacing: .5em; padding-left: .5em; }
.num--pin::placeholder { letter-spacing: 0; }
.fld__ok, .fld__clear { flex: none; display: none; }
.fld.ok .fld__ok { display: block; animation: pop .45s ease-out; margin-right: 6px; width: 30px; height: 30px; }
.fld.has-value:not(.ok) .fld__clear { display: flex; }
.fld__clear {
  width: 36px; height: 36px; margin-right: 4px; border: 0; border-radius: 50%; background: #EEF3F2; cursor: pointer;
  align-items: center; justify-content: center;
}
.fld__clear svg { width: 14px; height: 14px; }

.prog { display: flex; gap: 4px; justify-content: center; direction: ltr; }
.dot { width: 22px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .22); transition: background .2s; }
.dot.on { background: #FFFFFF; }
.prog.done .dot { background: var(--c-ok-light); }
.prog--pin .dot { width: 44px; }

.field-alert { display: none; text-align: center; font-size: 13px; font-weight: 700; line-height: 1.35; color: #FFD3CE; }
.field-alert.active { display: block; }
.error { margin: 0; text-align: center; font-size: 13px; font-weight: 700; line-height: 1.35; color: #FFD3CE; }
.error:empty { display: none; }

/* CTA */
.cta {
  position: relative; overflow: hidden; width: 100%; height: 64px; border: 0; border-radius: 18px; cursor: pointer;
  background: var(--c-accent); color: var(--c-brand); font: 800 22px/1 var(--font); letter-spacing: .07em;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  box-shadow: 0 6px 0 var(--c-accent-dark), 0 14px 24px rgba(196, 127, 0, .32); transition: transform .08s, box-shadow .08s;
}
body.rtl-text .cta { letter-spacing: 0; font-family: var(--font-ar); }
.cta::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; transform: skewX(-20deg);
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .65) 50%, rgba(255, 255, 255, 0) 100%);
  animation: shine 3.2s ease-in-out infinite;
}
.cta:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--c-accent-dark), 0 4px 10px rgba(196, 127, 0, .25); }
.cta:disabled { cursor: pointer; }
.cta__arr { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--c-brand); transition: transform .2s; flex: none; }
.cta__arr svg { width: 18px; height: 18px; }
body.rtl-text .cta__arr svg { transform: scaleX(-1); }
.cta:hover .cta__arr { transform: translateX(4px); }
.cta.pulse { animation: pulse 1.6s ease-in-out infinite; }
.cta.pulse .cta__arr { animation: nudge 1.6s ease-in-out infinite; }
.cta__spin { display: none; }
.cta.is-sending .cta__spin { display: block; animation: rot .8s linear infinite; }
.cta.is-sending .cta__go { display: none; }

.perks { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.perks__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; font-size: 13px; font-weight: 600; color: #FFFFFF; list-style: none; padding: 0; }
.perks__list li { display: flex; align-items: center; gap: 3px; }
.perks__list svg { width: 15px; height: 15px; flex: none; color: var(--c-ok-light); }
.perks__price { font-size: 12px; font-weight: 400; color: #BFD3D8; text-align: center; }

/* EXIT */
.exit-row { display: flex; justify-content: center; padding-top: 6px; }
.exit { padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--c-ink-2); }

/* PIN note + terms */
.terms { margin: 4px 12px 0; padding: 16px; border-radius: 20px; background: var(--c-terms); font-size: 12.5px; line-height: 1.5; color: var(--c-ink-2); }
.terms__note { margin-bottom: 10px; font-weight: 600; }
.terms__title { margin-bottom: 6px; font-size: 12.5px; font-weight: 800; letter-spacing: .03em; }
.terms ul { padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; }
.terms a { color: var(--c-brand); font-weight: 600; }

/* ================= CONTENT SECTIONS ================= */
.sec { margin: 36px 12px 0; }
.sec-title { margin-bottom: 16px; font-size: 26px; line-height: 1.2; font-weight: 800; text-align: center; color: var(--c-brand); }
.sec-title--lg { font-size: 30px; }

.how { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; list-style: none; padding: 0; }
.how__card { padding: 16px 12px; border-radius: 20px; background: #FFFFFF; box-shadow: var(--shadow-card); text-align: center; }
.how__title { font-size: 18px; font-weight: 700; line-height: 1.35; color: var(--c-brand); }
.how__num {
  display: inline-flex; align-items: center; justify-content: center; height: 24px; padding: 0 7px; margin-inline-end: 3px;
  border-radius: 8px; background: var(--c-accent); color: var(--c-brand); font-size: 14px; font-weight: 800; vertical-align: 2px;
}
.how__text { margin-top: 8px; font-size: 14px; line-height: 1.4; color: var(--c-ink-3); }

.about { margin-top: 40px; }
.about__title { margin-bottom: 14px; }
.about p { margin: 0 4px 12px; font-size: 15.5px; line-height: 1.55; color: var(--c-ink-2); }
.about p:last-of-type { margin-bottom: 18px; }
.about__img { width: 100%; height: 190px; object-fit: cover; border-radius: 20px; box-shadow: var(--shadow-card); }

.incl { margin-top: 28px; padding: 20px 18px; border-radius: 20px; background: var(--c-banner); }
.incl__title { margin-bottom: 12px; font-size: 20px; font-weight: 700; text-align: center; color: var(--c-brand); }
.incl ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; font-size: 14.5px; font-weight: 500; }
.incl li { display: flex; align-items: center; gap: 7px; }
.incl svg { width: 18px; height: 18px; flex: none; color: var(--c-ok); }

.feat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; list-style: none; padding: 0; }
.feat li { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.feat li > div { min-width: 0; }
.feat__icon { flex: none; width: 42px; height: 42px; border-radius: 12px; background: #FFFFFF; box-shadow: 0 3px 0 var(--c-line); display: flex; align-items: center; justify-content: center; color: var(--c-brand); }
.feat__icon svg { width: 24px; height: 24px; }
.feat__title { font-size: 16px; font-weight: 700; line-height: 1.2; }
.feat__text { margin-top: 3px; font-size: 13px; line-height: 1.35; color: var(--c-ink-3); }

.price { margin-top: 40px; text-align: center; }
.price .sec-title { font-size: 28px; margin-bottom: 0; }
.price__sub { margin: 8px 0 16px; font-size: 15.5px; color: var(--c-ink-2); }
.price__box { padding: 20px 18px; border-radius: 20px; background: #FFFFFF; box-shadow: var(--shadow-card); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.price__op { font-size: 14px; font-weight: 700; color: var(--c-brand); }
.price__val { font-size: 32px; font-weight: 800; line-height: 1.25; color: var(--c-brand); }
.price__trial { font-size: 14.5px; font-weight: 700; color: #1E7F52; }
.price__cancel { font-size: 13.5px; color: #3A4A4E; }

.faq { display: flex; flex-direction: column; gap: 8px; }
.faq__item { border-radius: 16px; background: #FFFFFF; box-shadow: 0 3px 0 var(--c-line); overflow: hidden; }
.faq__btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 14px 16px;
  border: 0; background: transparent; text-align: start; cursor: pointer; font: 700 15px/1.3 var(--font); color: var(--c-ink);
}
body.rtl-text .faq__btn { font-family: var(--font-ar); }
.faq__chev { flex: none; width: 18px; height: 18px; color: var(--c-brand); transition: transform .2s; }
.faq__btn[aria-expanded="true"] .faq__chev { transform: rotate(180deg); }
.faq__a { padding: 0 16px 14px; font-size: 14px; line-height: 1.5; color: #3A4A4E; }
.faq__a[hidden] { display: none; }

.final {
  margin-top: 36px; padding: 26px 18px 22px; border-radius: 24px; background: var(--c-brand); box-shadow: 0 14px 30px rgba(16, 70, 90, .22);
  text-align: center; display: flex; flex-direction: column; gap: 10px;
}
.final__title { font-size: 24px; line-height: 1.2; font-weight: 800; color: #FFFFFF; }
.final__text { font-size: 14.5px; line-height: 1.5; color: #CFE0E4; }
.final .cta { margin-top: 6px; }

.footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; padding: 24px 14px 40px; font-size: 13px; }
.footer a { color: var(--c-brand); text-decoration: none; font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.footer a:hover { text-decoration: underline; }

/* loader (engine: loading(state)) */
.loading { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(238, 244, 247, .75); opacity: 0; visibility: hidden; transition: opacity .2s ease; }
.loading.show { opacity: 1; visibility: visible; }
.loading__spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(16, 70, 90, .15); border-top-color: var(--c-brand); animation: rot .8s linear infinite; }

/* RTL details */
body.rtl-text .intro, body.rtl-text .terms, body.rtl-text .about p { line-height: 1.7; }
body.rtl-text .card__label, body.rtl-text .sec-title { letter-spacing: 0; }

/* ================= ANIMATIONS ================= */
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255, 182, 39, .7); } 70% { box-shadow: 0 0 0 12px rgba(255, 182, 39, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 70, 90, 0); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes shine { 0%, 55% { left: -60%; } 85%, 100% { left: 130%; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes rot { to { transform: rotate(360deg); } }

/* ================= SMALL PHONES < 375 ================= */
@media (max-width: 374.98px) {
  .card { margin-left: 8px; margin-right: 8px; padding: 12px 12px 14px; }
  .card__label { font-size: 22px; }
  .fld { gap: 6px; height: 60px; padding: 0 6px; }
  .cc { height: 44px; padding: 0 8px; gap: 5px; font-size: 17px; }
  .cc svg { width: 22px; height: 22px; }
  .num { font-size: 19px; }
  .num::placeholder { font-size: 15px; }
  .cta { font-size: 19px; height: 58px; gap: 10px; }
  .cta__arr { width: 30px; height: 30px; }
  .dot { width: 18px; }
  .prog--pin .dot { width: 40px; }
  .how__title { font-size: 16px; }
  .sec-title--lg { font-size: 26px; }
  .sec-title { font-size: 23px; }
  .card__label--pin { font-size: 30px; }
  .header { padding: 8px 10px; }
  .brand { font-size: 17px; }
  .langs { font-size: 14px; }
  .lang { min-width: 26px; padding: 10px 2px; }
}
@media (max-width: 339.98px) {
  .feat { grid-template-columns: minmax(0, 1fr); }
  .incl ul { grid-template-columns: minmax(0, 1fr); }
  .how { grid-template-columns: minmax(0, 1fr); }
  .perks__list { font-size: 12px; }
}
body.rtl-text .card__label { font-size: 21px; line-height: 1.35; }
body.rtl-text .card__label--pin { font-size: 30px; }

/* ================= TABLET ≥ 600 ================= */
@media (min-width: 600px) {
  .intro { max-width: 520px; }
  .card { width: auto; max-width: 480px; margin-left: auto; margin-right: auto; }
  .terms { max-width: 560px; margin-left: auto; margin-right: auto; }
  .content { max-width: 600px; padding: 0 12px; }
  .sec { margin-left: 0; margin-right: 0; }
  .about__img { height: auto; aspect-ratio: 602 / 339; }
}

/* ================= TABLET ≥ 768 ================= */
@media (min-width: 768px) {
  .topline { font-size: 14px; }
  .header { padding: 10px 24px; }
  .brand { font-size: 21px; }
  .content { max-width: 720px; }
  .sec { margin-top: 48px; }
  .sec-title { font-size: 30px; }
  .sec-title--lg { font-size: 34px; }
  .how { gap: 14px; }
  .how__card { padding: 20px 16px; }
  .about__text { max-width: 640px; margin: 0 auto; }
  .about p { margin-left: 0; margin-right: 0; text-align: center; }
  .about__img { max-width: 602px; margin: 0 auto; }
  .incl { padding: 24px 28px; }
  .incl ul { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
  .feat { gap: 24px 28px; }
  .price__box, .faq { max-width: 600px; margin-left: auto; margin-right: auto; }
  .final { padding: 32px 40px 28px; }
  .final .cta { max-width: 420px; margin-left: auto; margin-right: auto; }
}

/* ================= LAPTOP / DESKTOP ≥ 1024 ================= */
@media (min-width: 1024px) {
  .header { max-width: 1040px; }
  .content { max-width: 1000px; padding: 0 24px; }
  .sec { margin-top: 64px; }
  .how { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .how__card { padding: 22px 16px; }
  .about__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
  .about__text { max-width: none; margin: 0; }
  .about__title { text-align: start; }
  .about p { text-align: start; }
  .about__img { max-width: none; }
  .incl { max-width: 760px; margin-left: auto; margin-right: auto; }
  .feat { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .final { max-width: 760px; margin-left: auto; margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ================= LAYOUT CONTAINER ================= */
.content { width: 100%; margin: 0 auto; }

/* ================= BANNER v2: missing puzzle piece (pure SVG, scales with the card) ================= */
.pbanner { width: 100%; max-width: 334px; margin: 0 auto; }
.pbanner svg { width: 100%; height: auto; overflow: visible; }
.chv { animation: chv 1.4s ease-in-out infinite; opacity: .2; }
.chv.c2 { animation-delay: .2s; }
.chv.c3 { animation-delay: .4s; }
.pc { transform-box: fill-box; transform-origin: center; transition: transform .45s cubic-bezier(.3, 1.5, .5, 1); }
.pc.p0 { transform: translate(-6px, 80px) rotate(-18deg); }
.pc.p1 { transform: translate(-5.3px, 71.1px) rotate(-16deg); }
.pc.p2 { transform: translate(-4.7px, 62.2px) rotate(-14deg); }
.pc.p3 { transform: translate(-4px, 53.3px) rotate(-12deg); }
.pc.p4 { transform: translate(-3.3px, 44.4px) rotate(-10deg); }
.pc.p5 { transform: translate(-2.7px, 35.6px) rotate(-8deg); }
.pc.p6 { transform: translate(-2px, 26.7px) rotate(-6deg); }
.pc.p7 { transform: translate(-1.3px, 17.8px) rotate(-4deg); }
.pc.p8 { transform: translate(-.7px, 8.9px) rotate(-2deg); }
.pc.pv { transform: translate(0, 0) rotate(0deg); }
.pc__body { transform-box: fill-box; transform-origin: center; filter: url(#pcShadow); animation: bob 2.2s ease-in-out infinite; }
.pc.pv .pc__body { animation: none; filter: url(#pcGlow); }
.pwin { display: none; }
.pbanner.is-valid .pwin { display: inline; }
.pwin g { transform-box: fill-box; transform-origin: center; animation: pop .45s ease-out; }
@keyframes chv { 0%, 100% { opacity: .2; } 40% { opacity: 1; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
