/* ==========================================================================
   QR registration page — app-like, no zoom, mobile first
   ========================================================================== */
html, body { height: 100%; }
html { touch-action: manipulation; overscroll-behavior: none; }
body.page-register { margin: 0; overflow: hidden; background: var(--forest); -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
body.page-register :not(input):not(textarea):not(select) { -webkit-user-select: none; user-select: none; }

/* A soft prism flare, echoing the light leak in the brand artwork */
.bg-flare { position: fixed; z-index: 0; width: 70vmax; height: 70vmax; top: -30vmax; inset-inline-end: -25vmax; pointer-events: none; background: radial-gradient(circle, rgba(200, 255, 110, .16), transparent 60%); animation: flare 14s ease-in-out infinite alternate; }
@keyframes flare { from { transform: translate3d(0, 0, 0) scale(1); opacity: .7; } to { transform: translate3d(-6vmax, 4vmax, 0) scale(1.15); opacity: 1; } }

.app { position: relative; z-index: 2; height: 100vh; height: 100dvh; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 20px calc(env(safe-area-inset-bottom, 0px) + 14px); }

/* ── Top bar ── */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 60px; flex-shrink: 0; }
.topbar-side { display: flex; align-items: center; }
.topbar-side.end { justify-content: flex-end; }
.brand img { display: block; height: 44px; width: auto; filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .35)); }
.btn-back { opacity: 0; transform: translateX(-8px); pointer-events: none; transition: opacity .3s, transform .3s var(--ease); }
[dir="rtl"] .btn-back { transform: translateX(8px); }
.app.can-back .btn-back { opacity: 1; transform: none; pointer-events: auto; }
.lang-btn { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: var(--r-pill); background: var(--glass); border: 1px solid var(--line); color: #fff; text-decoration: none; font-size: 13.5px; font-weight: 600; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .2s, border-color .2s; }
.lang-btn:hover { background: var(--glass-strong); border-color: rgba(200, 255, 110, .4); color: #fff; }
.lang-btn i { color: var(--lime); }
.lang-btn span:lang(ar) { font-family: var(--font-ar); }
.lang-btn span:lang(en) { font-family: var(--font-display); }

/* ── Progress ── */
.progress-x { flex-shrink: 0; padding: 6px 2px 0; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .4s var(--ease), opacity .3s; }
.app.show-progress .progress-x { max-height: 40px; opacity: 1; }
.progress-meta { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px; }
[dir="rtl"] .progress-meta { font-family: var(--font-ar); letter-spacing: 0; text-transform: none; font-size: 12px; }
.progress-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--lime-deep), var(--lime)); box-shadow: 0 0 14px rgba(200, 255, 110, .7); transition: width .6s var(--ease); }

/* ── Stage & screens ── */
.stage { position: relative; flex: 1; min-height: 0; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  opacity: 0; visibility: hidden; pointer-events: none; transform: translate3d(48px, 0, 0); filter: blur(6px);
  transition: opacity .5s var(--ease), transform .6s var(--ease), filter .5s var(--ease), visibility 0s linear .6s; }
.screen::-webkit-scrollbar { display: none; }
.screen.is-active { opacity: 1; visibility: visible; pointer-events: auto; transform: none; filter: none; transition: opacity .5s var(--ease) .08s, transform .6s var(--ease) .08s, filter .5s var(--ease) .08s, visibility 0s; }
.screen-inner { margin: auto 0; width: 100%; padding: 18px 2px 8px; }

/* Staggered entrance of the active step's content */
.screen.entering .screen-inner > * { animation: rise .7s var(--ease) both; }
.screen.entering .screen-inner > *:nth-child(2) { animation-delay: .08s; }
.screen.entering .screen-inner > *:nth-child(3) { animation-delay: .14s; }
.screen.entering .screen-inner > *:nth-child(4) { animation-delay: .2s; }
.screen.entering .screen-inner > *:nth-child(5) { animation-delay: .26s; }
.screen.entering .screen-inner > *:nth-child(6) { animation-delay: .32s; }
.screen.entering .screen-inner > *:nth-child(n+7) { animation-delay: .38s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ── Intro ── */
.intro { text-align: center; display: flex; flex-direction: column; align-items: center; }
.emblem { position: relative; width: min(210px, 52vw); aspect-ratio: 1; margin: 4px auto 22px; }
.emblem-ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 26s linear infinite; overflow: visible; }
.emblem-ring text { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; fill: rgba(255, 255, 255, .85); }
.emblem-ring .ring-outline { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 1; stroke-dasharray: 2 5; }
.emblem-core { position: absolute; inset: 22%; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .22), rgba(255, 255, 255, .05) 60%), rgba(15, 46, 18, .35);
  border: 1px solid rgba(255, 255, 255, .22); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 20px 50px -12px rgba(0, 0, 0, .5), 0 0 60px -10px rgba(200, 255, 110, .35);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.emblem-num { font-family: 'Syne', sans-serif; font-weight: 800; font-size: clamp(54px, 15vw, 74px); line-height: .85; color: var(--lime); text-shadow: 0 6px 30px rgba(200, 255, 110, .45); animation: numPop 1.1s var(--ease-spring) .2s both; }
.emblem-sub { font-family: var(--font-mono); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: rgba(255, 255, 255, .8); margin-top: 6px; }
[dir="rtl"] .emblem-sub { font-family: var(--font-ar); letter-spacing: 0; font-size: 13px; }
@keyframes numPop { from { opacity: 0; transform: scale(.4) rotate(-12deg); } to { opacity: 1; transform: none; } }

.intro-chip .countdown:empty { display: none; }
.intro-chip .countdown { color: var(--lime); }
.intro-chip .countdown::before { content: ''; display: inline-block; width: 1px; height: 12px; background: var(--line); margin-inline-end: 9px; vertical-align: -1px; }

.headline { margin: 22px 0 0; font-family: 'Syne', sans-serif; font-weight: 800; font-size: clamp(2.35rem, 11.4vw, 3.5rem); line-height: .95; letter-spacing: -.035em; color: #fff; text-wrap: balance; }
.headline .hl-b { color: var(--lime); }
[dir="rtl"] .headline { font-family: var(--font-ar); font-weight: 700; letter-spacing: 0; line-height: 1.15; font-size: clamp(2.3rem, 11vw, 3.3rem); }

.lead-typed { margin: 18px auto 0; max-width: 34ch; font-size: 16.5px; line-height: 1.55; color: rgba(255, 255, 255, .85); font-weight: 500; min-height: 3.1em; }
.intro-actions { width: 100%; margin-top: 30px; }
.micro { margin: 14px 0 0; font-size: 13px; color: var(--text-dim); display: inline-flex; align-items: center; gap: 7px; }
.micro i { color: var(--lime); }

/* ── Typewriter ── */
.typed { display: inline-grid; text-align: inherit; }
.typed > span { grid-area: 1 / 1; }
.typed .t-ghost { visibility: hidden; }
.typed .t-live::after { content: ''; display: inline-block; width: .08em; min-width: 2px; height: 1em; margin-inline-start: 3px; vertical-align: -.12em; background: var(--lime); border-radius: 2px; opacity: 0; }
.typed.is-typing .t-live::after { opacity: 1; animation: caret .8s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.typed.fade-in .t-live { animation: textFade .7s var(--ease) both; }
@keyframes textFade { from { opacity: 0; filter: blur(4px); } to { opacity: 1; filter: none; } }

/* ── Steps ── */
.step-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 18px; font-size: 22px; color: var(--lime-ink); background: var(--lime); box-shadow: 0 14px 34px -12px rgba(200, 255, 110, .7); transform: rotate(-6deg); margin-bottom: 22px; }
.screen-title { margin: 0; font-family: 'Syne', sans-serif; font-weight: 800; font-size: clamp(1.75rem, 8vw, 2.25rem); line-height: 1.08; letter-spacing: -.025em; text-wrap: balance; }
[dir="rtl"] .screen-title { font-family: var(--font-ar); font-weight: 700; letter-spacing: 0; line-height: 1.3; }
.screen-hint { margin: 12px 0 26px; color: var(--text-dim); font-size: 15.5px; line-height: 1.5; }
.field-group + .field-group { margin-top: 14px; }
.field-help { margin: 12px 2px 0; font-size: 13px; color: var(--text-faint); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.field-help bdi { color: var(--text-dim); font-family: var(--font-mono); }
.step-actions { margin-top: 30px; }
.privacy { margin: 14px 0 0; font-size: 12.5px; color: var(--text-faint); display: flex; align-items: center; justify-content: center; gap: 7px; text-align: center; }

#phone { font-family: var(--font-mono); font-size: 19px; letter-spacing: .06em; }
[dir="rtl"] #phone { text-align: right; }

.welcome-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 22px; border-radius: var(--r-md); background: rgba(200, 255, 110, .12); border: 1px solid rgba(200, 255, 110, .32); }
.welcome-note i { color: var(--lime); font-size: 18px; margin-top: 2px; }
.welcome-note strong { display: block; font-size: 15px; }
.welcome-note span { display: block; font-size: 13.5px; color: rgba(255, 255, 255, .78); line-height: 1.45; margin-top: 2px; }

/* Gender tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tile { position: relative; cursor: pointer; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile-body { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; height: 156px; border-radius: var(--r-lg); background: rgba(255, 255, 255, .07); border: 1.5px solid var(--line); transition: all .3s var(--ease); }
.tile-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .08); font-size: 28px; color: #fff; transition: all .35s var(--ease-spring); }
.tile-label { font-size: 16px; font-weight: 700; }
.tile-check { position: absolute; top: 12px; inset-inline-end: 12px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--lime); color: var(--lime-ink); font-size: 12px; transform: scale(0); transition: transform .35s var(--ease-spring); }
.tile:hover .tile-body { border-color: rgba(200, 255, 110, .4); }
.tile input:focus-visible + .tile-body { box-shadow: 0 0 0 4px rgba(200, 255, 110, .3); }
.tile input:checked + .tile-body { background: rgba(200, 255, 110, .14); border-color: var(--lime); box-shadow: 0 16px 40px -18px rgba(200, 255, 110, .7); }
.tile input:checked + .tile-body .tile-icon { background: var(--lime); color: var(--lime-ink); transform: scale(1.08) rotate(-6deg); }
.tile input:checked + .tile-body .tile-check { transform: scale(1); }
.tiles.is-invalid .tile-body { border-color: var(--danger); }
.tiles.shake { animation: shake .42s cubic-bezier(.36, .07, .19, .97); }

/* DOB */
.dob-grid { display: grid; grid-template-columns: .8fr 1.45fr 1fr; gap: 10px; }
.dob-grid .field .control { padding: 26px 30px 8px 16px; font-size: 16px; }
[dir="rtl"] .dob-grid .field .control { padding: 26px 16px 8px 30px; }
.dob-grid .field label { inset-inline-start: 16px; }
.dob-grid .field .chev { inset-inline-end: 12px; }
.dob-grid.is-invalid .control { border-color: var(--danger); }
.dob-grid.shake { animation: shake .42s cubic-bezier(.36, .07, .19, .97); }

/* Review */
.review-list { list-style: none; margin: 0; padding: 6px; border-radius: var(--r-lg); background: rgba(255, 255, 255, .06); border: 1px solid var(--line-soft); }
.review-list li { display: flex; align-items: center; gap: 14px; padding: 13px 12px; border-radius: 16px; }
.review-list li + li { border-top: 1px dashed rgba(255, 255, 255, .09); }
.review-list .r-icon { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; background: rgba(200, 255, 110, .14); color: var(--lime); font-size: 15px; }
.review-list .r-body { flex: 1; min-width: 0; }
.review-list .r-label { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
[dir="rtl"] .review-list .r-label { font-family: var(--font-ar); letter-spacing: 0; text-transform: none; font-size: 12px; }
.review-list .r-value { display: block; font-size: 16px; font-weight: 700; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-list .r-edit { border: 0; background: transparent; color: var(--lime); font-weight: 600; font-size: 13.5px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-family: inherit; }
.review-list .r-edit:hover { background: rgba(200, 255, 110, .1); }

/* ── Final screens ── */
.final { text-align: center; display: flex; flex-direction: column; align-items: center; }
.final-badge { position: relative; width: 132px; height: 132px; margin: 0 auto 28px; display: grid; place-items: center; }
.pulse-ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(200, 255, 110, .5); animation: pulseRing 2.6s ease-out infinite; }
.pulse-ring.delay { animation-delay: 1.3s; }
@keyframes pulseRing { from { transform: scale(.8); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.check-svg { width: 120px; height: 120px; }
.check-circle { fill: rgba(200, 255, 110, .14); stroke: var(--lime); stroke-width: 4; stroke-dasharray: 330; stroke-dashoffset: 330; transform: rotate(-90deg); transform-origin: center; }
.check-mark { fill: none; stroke: var(--lime); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; }
.screen.is-active .check-circle { animation: draw .8s var(--ease) .15s forwards; }
.screen.is-active .check-mark { animation: draw .5s var(--ease) .8s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.complete-core { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; font-size: 46px; color: var(--lime-ink); background: var(--lime); box-shadow: 0 20px 60px -15px rgba(200, 255, 110, .8); }
.screen.is-active .complete-core { animation: numPop .9s var(--ease-spring) .1s both; }
.final-title { margin: 0; font-family: 'Syne', sans-serif; font-weight: 800; font-size: clamp(1.8rem, 8.6vw, 2.4rem); line-height: 1.08; letter-spacing: -.03em; text-wrap: balance; }
[dir="rtl"] .final-title { font-family: var(--font-ar); font-weight: 700; letter-spacing: 0; line-height: 1.3; }
.final-text { margin: 16px auto 0; max-width: 34ch; color: rgba(255, 255, 255, .8); font-size: 16px; line-height: 1.6; }
.final-follow { margin: 30px 0 12px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint); }
[dir="rtl"] .final-follow { font-family: var(--font-ar); letter-spacing: 0; text-transform: none; font-size: 13px; }
.btn-again { margin-top: 30px; }

.socials { display: flex; gap: 12px; justify-content: center; }
.social-btn { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); color: #fff; font-size: 18px; text-decoration: none; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform .25s var(--ease-spring), background .25s, border-color .25s; }
.social-btn:hover { color: #fff; transform: translateY(-3px) scale(1.06); }
.social-btn.instagram:hover { background: rgba(225, 48, 108, .3); border-color: rgba(225, 48, 108, .5); }
.social-btn.facebook:hover { background: rgba(24, 119, 242, .3); border-color: rgba(24, 119, 242, .5); }
.social-btn.whatsapp:hover { background: rgba(37, 211, 102, .3); border-color: rgba(37, 211, 102, .5); }
.social-btn.tiktok:hover { background: rgba(255, 0, 80, .25); border-color: rgba(255, 0, 80, .4); }

/* Short screens (small phones / keyboard open) */
@media (max-height: 700px) {
  .emblem { width: min(160px, 42vw); margin-bottom: 14px; }
  .headline { margin-top: 16px; }
  .intro-actions { margin-top: 22px; }
  .step-icon { width: 48px; height: 48px; font-size: 19px; margin-bottom: 16px; }
  .screen-hint { margin-bottom: 20px; }
  .tile-body { height: 132px; }
}
@media (min-width: 768px) {
  .app { padding-top: 26px; padding-bottom: 26px; }
  .brand img { height: 52px; }
}

/* Refinements */
.emblem-ring text { direction: ltr; unicode-bidi: bidi-override; }
.intro-chip { white-space: nowrap; max-width: 100%; }
@media (max-width: 400px) {
  .intro-chip { font-size: 10px; letter-spacing: .09em; padding: 7px 13px; gap: 7px; }
  [dir="rtl"] .intro-chip { font-size: 12px; }
}
.headline .hl-a, .headline .hl-b { display: block; white-space: nowrap; }
.headline { font-size: clamp(2.1rem, 10vw, 3.5rem); }
[dir="rtl"] .headline { font-size: clamp(2.2rem, 10.5vw, 3.3rem); }
