/* ═════════════ Rev 3 (B): catalogue gate steps, shared country picker, partner form (js/country.js, js/gate.js, js/partnerform.js) ═════════════ */

/* step indicator */
.fstep { display: grid; gap: 8px; margin-bottom: 2px; }
.fstep__t { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--stone); }
html[lang="ar"] .fstep__t, html[lang^="zh"] .fstep__t { text-transform: none; letter-spacing: 0; font-size: 13px; }
.fstep__bar { height: 4px; border-radius: 4px; background: var(--ink-600); overflow: hidden; }
.fstep__bar i { display: block; height: 100%; width: 0; background: var(--gold-300); border-radius: 4px; transition: width .45s var(--ease); }
html[dir="rtl"] .fstep__bar i { margin-inline-start: 0; }
@media (prefers-reduced-motion: reduce) { .fstep__bar i { transition: none; } }

.gate__panel { display: grid; gap: 14px; }
.gate__panel[hidden], .gate__f[hidden] { display: none; }
.gate__opt { font-family: var(--f-mono); font-size: 11px; letter-spacing: .04em; text-transform: none; color: var(--stone); opacity: .85; }
.req { color: var(--gold-300); margin-inline-start: 2px; }
.gate__hint { color: var(--stone); font-size: .88rem; line-height: 1.4; margin: 0; }
.gate__act--steps { display: flex; gap: 10px; }
.gate__act--steps .btn { flex: 1 1 auto; width: auto; }
.gate__act--steps .btn--ghost { flex: 0 0 auto; }
.gate__act--steps .btn[hidden] { display: none; }

/* other text-like controls inside the gate / partner dialogs share the input look */
.gate__f textarea, .gate__f input[type="date"], .gate__f select { width: 100%; padding: 0 16px; border-radius: 12px; border: 1px solid var(--ink-600); background: var(--ink-900); color: var(--white); font-size: 16px; font-family: inherit; }
.gate__f textarea { padding: 12px 16px; min-height: 92px; line-height: 1.45; resize: vertical; }
.gate__f input[type="date"], .gate__f select { height: 50px; }
.gate__f input[type="date"] { color-scheme: dark; }
.gate__f textarea:focus-visible, .gate__f input[type="date"]:focus-visible, .gate__f select:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 1px; border-color: var(--gold-300); }
.gate__f textarea[aria-invalid="true"], .gate__f input[aria-invalid="true"], .gate__f select[aria-invalid="true"] { border-color: var(--clay); }
.gate__f input::placeholder, .gate__f textarea::placeholder { color: var(--stone); opacity: .7; }
.sel { position: relative; }
.sel select { appearance: none; -webkit-appearance: none; padding-inline-end: 44px; text-overflow: ellipsis; }
.sel select option { background: var(--ink-900); color: var(--white); }
.sel__ch { position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--gold-300); pointer-events: none; }
.sel__ch svg { width: 100%; height: 100%; display: block; }

/* WhatsApp field: the +code follows the country picker */
.phone { display: flex; align-items: stretch; }
.gate__f .phone input[type="tel"] { flex: 1 1 auto; min-width: 0; border-start-start-radius: 0; border-end-start-radius: 0; }
.phone__pre { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; padding: 0 12px; height: 50px; border: 1px solid var(--ink-600); border-inline-end: 0; border-start-start-radius: 12px; border-end-start-radius: 12px; background: var(--ink-700, var(--ink-800)); color: var(--gold-300); font-family: var(--f-mono); font-size: 15px; }
.phone:focus-within .phone__pre { border-color: var(--gold-300); }

/* chips: checkbox / radio groups */
.gate__fs { display: block; border: 0; margin: 0; padding: 0; min-width: 0; }
.gate__fs legend { float: none; width: 100%; padding: 0; margin: 0 0 10px; font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--stone); }
html[lang="ar"] .gate__fs legend { text-transform: none; font-size: 13px; }
.fchips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip { position: relative; display: inline-flex; }
.fchip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.fchip span { font-family: var(--f-body); text-transform: none; letter-spacing: 0; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--ink-600); background: var(--ink-900); color: var(--cream); font-size: .95rem; line-height: 1.25; transition: background .2s, border-color .2s, color .2s; }
.fchip:hover span { border-color: var(--stone); }
.fchip input:checked + span { background: var(--gold-300); border-color: var(--gold-300); color: var(--ink-900); font-weight: 500; }
.fchip input:focus-visible + span { outline: 2px solid var(--gold-300); outline-offset: 2px; }
.fchip input:disabled { cursor: not-allowed; }
.fchip.is-off span { opacity: .4; }
.pf__cnt { margin-top: 8px; }

/* country picker (editable combobox + listbox) */
.cb { position: relative; display: block; }
.gate__f .cb .cb__in { padding-inline-start: 50px; padding-inline-end: 44px; text-overflow: ellipsis; }
.cb__flag { position: absolute; inset-inline-start: 16px; top: 0; height: 50px; display: flex; align-items: center; font-size: 22px; line-height: 1; pointer-events: none; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.cb__chev { position: absolute; inset-inline-end: 6px; top: 0; height: 50px; width: 38px; display: flex; align-items: center; justify-content: center; color: var(--gold-300); cursor: pointer; }
.cb__chev svg { width: 16px; height: 16px; transition: transform .2s; }
.cb.is-open .cb__chev svg { transform: rotate(180deg); }
.cb__list { position: absolute; z-index: 5; inset-inline: 0; top: calc(100% + 6px); max-height: min(264px, 42vh); overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 6px; list-style: none; background: var(--ink-900); border: 1px solid var(--gold-300); border-radius: 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.cb__list[hidden] { display: none; }
.cb__list li[role="option"] { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: 8px; color: var(--cream); cursor: pointer; font-size: .98rem; }
.cb__list li.is-active, .cb__list li[role="option"]:hover { background: rgba(227, 190, 110, .16); color: var(--white); }
.cb__list li[aria-selected="true"] .cb__on { color: var(--gold-300); }
.cb__of { font-size: 20px; line-height: 1; width: 26px; text-align: center; flex: none; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.cb__on { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.cb__oc { flex: none; font-family: var(--f-mono); font-size: 13px; color: var(--stone); }
.cb__none { padding: 12px 10px; color: var(--stone); }

/* partner form */
.pform .gate__box { width: min(640px, 100%); }
.pf { gap: 18px; }
.pf__body { display: grid; gap: 18px; }
.pform .gate__title { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
.pform .gate__f > label { text-transform: none; font-family: var(--f-body); font-size: .98rem; letter-spacing: 0; color: var(--cream); line-height: 1.35; }
.pform .gate__fs legend { text-transform: none; font-family: var(--f-body, inherit); font-size: .98rem; letter-spacing: 0; color: var(--cream); line-height: 1.35; }
.pform .gate__f--check label { font-size: .95rem; }

@media (max-width: 640px) {
  .gate__f .cb .cb__in, .gate__f input, .gate__f select, .gate__f textarea { font-size: 16px; }   /* no iOS zoom on focus */
  .cb__list { max-height: 38vh; }
  .fchip span { min-height: 44px; }
  .pform .gate__scroll { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}
