/* Structure & behaviour only. Visual design lives in css/themes/*.css
   NOTE: don't put backdrop-filter/filter/transform on .f-modal in a theme - it breaks the mobile bottom sheet (position: fixed). */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

.f-overlay { position: fixed; inset: 0; display: none; justify-content: center; z-index: 1000; overflow: auto; }
.f-overlay.is-open { display: flex; }
.f-modal { position: relative; width: 100%; margin: auto; }
.f-close { position: absolute; }

.f-chips { display: flex; flex-wrap: wrap; }
.f-chip { cursor: pointer; }

.f-dd { position: relative; }
.f-dd-btn { display: flex; align-items: center; width: 100%; cursor: pointer; text-align: start; }
.f-dd-btn:disabled { cursor: not-allowed; }
.f-dd-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-ico:empty { display: none; }
.f-dd-panel { position: absolute; top: 100%; left: 0; right: 0; z-index: 5; display: none; flex-direction: column; max-height: 320px; }
.f-dd.is-open .f-dd-panel { display: flex; }
.f-dd-head { display: none; }
.f-search { width: 100%; }
.f-dd-list { margin: 0; padding: 0; list-style: none; overflow: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.f-dd-opt { display: flex; align-items: center; cursor: pointer; }
.f-dd-opt[hidden] { display: none; }

/* phones: the country list becomes a bottom sheet */
@media (max-width: 520px) {
  .f-dd.is-open::before { content: ''; position: fixed; inset: 0; z-index: 4; background: rgba(0, 0, 0, .55); }
  .f-dd-panel { position: fixed; top: auto; left: 0; right: 0; bottom: 0; max-height: 75vh; max-height: 75dvh; }
  .f-dd-head { display: block; }
}

.f-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.f-fld { display: block; }
.f-input { width: 100%; }
.f-dd-opt.f-dd-none { display: flex; }
.f-tg { cursor: pointer; }
.f-tg:disabled { pointer-events: none; }

/* Shared look of all components, driven by CSS variables. A design = variables + layout + art (design.css). */
:root {
  --text: #fff; --muted: #a9c0e4; --accent: #2f9bff; --gold: #f5b942; --err: #ff9b9b; --close: #dce9ff;
  --page-bg: #0b1a3a; --overlay: rgba(2, 8, 20, .75);
  --card-bg: #0a1c40; --card-blur: none; --card-border: 1px solid rgba(80, 170, 255, .6);
  --card-shadow: 0 0 34px rgba(47, 155, 255, .4); --radius: 20px; --max-w: 620px; --pad: 30px 34px 24px;
  --field-bg: rgba(30, 80, 170, .26); --field-line: rgba(110, 170, 255, .4); --field-text: #fff;
  --panel-bg: rgba(8, 28, 76, .96); --panel-hover: rgba(47, 155, 255, .22); --panel-active: rgba(47, 155, 255, .35);
  --btn-bg: linear-gradient(180deg, #55b2ff 0%, #2a85f5 45%, #1a63de 100%); --btn-text: #fff;
  --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 8px 28px rgba(47, 155, 255, .5);
  --btn-off-bg: rgba(40, 62, 105, .8); --btn-off-text: #7f95bd;
  --note-bg: rgba(47, 155, 255, .1); --note-line: rgba(110, 170, 255, .4); --note-text: #cfe0ff; --note-strong: #fff;
  --feat-text: #e6efff; --feat-icon: var(--accent);
  --ok-bg: rgba(40, 190, 110, .14); --ok-line: rgba(70, 210, 130, .5); --ok-icon: #4fe08f;
  --title-size: 28px; --title-align: center; --art-display: none;
}


.f-overlay { background: var(--overlay); padding: 16px; z-index: 10000; font: 16px/1.4 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
.f-overlay p, .f-overlay h2, .f-overlay h3 { color: inherit; }
.f-overlay .f-sub, .f-overlay .f-lead-sub, .f-overlay .f-note { color: var(--muted); }
.f-overlay .f-note { color: var(--note-text); }
.f-modal { max-width: var(--max-w); padding: var(--pad); border-radius: var(--radius); isolation: isolate; color: var(--text);
           border: var(--card-border); box-shadow: var(--card-shadow); animation: f-pop .2s ease-out; }
.f-modal::before { content: ''; position: absolute; inset: 0; z-index: -2; border-radius: inherit; background: var(--card-bg);
                   backdrop-filter: var(--card-blur); -webkit-backdrop-filter: var(--card-blur); }
@keyframes f-pop { from { opacity: 0; transform: translateY(10px); } }

.f-art { display: var(--art-display); position: absolute; z-index: -1; pointer-events: none; }
.f-content { position: relative; display: flex; flex-direction: column; }
.f-logo { display: none; font-weight: 900; font-style: italic; font-size: 26px; letter-spacing: .5px; }

.f-close { top: 14px; right: 16px; z-index: 3; width: 34px; height: 34px; border: 0; background: none; color: var(--close);
           font-size: 30px; font-weight: 200; line-height: 1; cursor: pointer; border-radius: 50%; }
.f-close:hover { background: rgba(128, 128, 128, .2); }
.f-title { margin: 0; text-align: var(--title-align); font-size: var(--title-size); font-weight: 800; letter-spacing: .2px; }
.f-accent { color: var(--accent); }
.f-sub { margin: 6px 0 24px; text-align: var(--title-align); color: var(--muted); font-size: 16px; }

.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.f-label { display: block; margin-bottom: 8px; font-size: 14px; color: var(--muted); }

.f-dd-btn { gap: 12px; height: 54px; padding: 0 16px; font: inherit; font-size: 16px; font-weight: 500; color: var(--field-text);
            background: var(--field-bg); border: 1px solid var(--field-line); border-radius: 12px; transition: border-color .15s; }
.f-dd-btn:hover, .f-dd.is-open .f-dd-btn { border-color: var(--accent); }
.f-dd:not(.has-value) .f-dd-val { color: var(--muted); }
.f-ico { display: flex; width: 26px; height: 26px; align-items: center; justify-content: center; color: var(--field-text); opacity: .85; }
.f-ico svg { width: 24px; height: 24px; }
.f-flag { width: 26px; height: 19px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(128, 128, 128, .3); }
.f-chev { width: 12px; height: 8px; color: var(--field-text); opacity: .8; transition: transform .15s; }
.f-dd.is-open .f-chev { transform: rotate(180deg); }

.f-dd-panel { margin-top: 6px; color: var(--field-text); background: var(--panel-bg); border: 1px solid var(--field-line);
              border-radius: 12px; box-shadow: 0 14px 34px rgba(0, 0, 0, .35); overflow: hidden; }
.f-dd-head { flex: none; padding: 18px 16px 10px; font-size: 18px; font-weight: 600; text-align: center; }
.f-search { flex: none; height: 52px; margin: 8px 10px; width: auto; padding: 0 16px 0 46px; font: inherit; font-size: 17px; /* 16px+ stops iOS zoom */
            color: var(--field-text); border: 1px solid var(--field-line); border-radius: 12px; outline: none; -webkit-appearance: none; appearance: none;
            background: var(--field-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%238a9bb8' stroke-width='2'%3E%3Ccircle cx='9' cy='9' r='6'/%3E%3Cpath d='M14 14l4 4'/%3E%3C/svg%3E") no-repeat 16px center; }
.f-search:focus { border-color: var(--accent); }
.f-search::placeholder { color: var(--muted); }
.f-dd-opt { gap: 12px; min-height: 48px; padding: 10px 16px; }
.f-dd-opt:hover { background: var(--panel-hover); }
.f-dd-opt.is-active { background: var(--panel-active); font-weight: 600; }
.f-dd-none { color: var(--muted); }

/* lead form ("country not in the list") */
.f-lead-title { margin: 22px 0 4px; text-align: center; font-size: 20px; font-weight: 700; }
.f-lead-sub { margin: 0 0 16px; text-align: center; color: var(--muted); font-size: 15px; }
.f-lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.f-input { height: 52px; padding: 0 14px; font: inherit; font-size: 16px; color: var(--field-text); background: var(--field-bg);
           border: 1px solid var(--field-line); border-radius: 12px; outline: none; transition: border-color .15s; }
.f-input:focus { border-color: var(--accent); }
.f-input::placeholder { color: var(--muted); opacity: .7; }
.f-lead-msg { min-height: 20px; margin: 10px 0 0; font-size: 14px; text-align: center; }
.f-lead-msg[data-state=error] { color: var(--err); }
.f-lead-btn { margin-top: 6px; }
.f-thanks { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 26px; padding: 22px 16px;
            text-align: center; font-size: 18px; font-weight: 600; background: var(--ok-bg); border: 1px solid var(--ok-line); border-radius: 14px; }
.f-thanks svg { width: 44px; height: 44px; color: var(--ok-icon); }
.f-thanks p { margin: 0; }

.f-tg { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 58px; margin-top: 22px;
        font: inherit; font-size: 19px; font-weight: 600; color: var(--btn-text); border: 0; border-radius: 14px;
        background: var(--btn-bg); box-shadow: var(--btn-shadow); transition: filter .15s, transform .1s; }
.f-tg:hover:not(:disabled) { filter: brightness(1.08); }
.f-tg:active:not(:disabled) { transform: translateY(1px); }
.f-tg:disabled { background: var(--btn-off-bg); color: var(--btn-off-text); box-shadow: none; }
.f-tg-icon { width: 24px; height: 24px; fill: currentColor; }

.f-feats { display: flex; justify-content: space-around; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; color: var(--feat-text); font-size: 14px; }
.f-feats li { display: flex; align-items: center; gap: 8px; }
.f-feats svg { width: 18px; height: 18px; color: var(--feat-icon); flex: none; }

.f-note { display: flex; gap: 10px; align-items: flex-start; margin: 22px 0 0; padding: 13px 16px; font-size: 14px; line-height: 1.45;
          color: var(--note-text); background: var(--note-bg); border: 1px solid var(--note-line); border-radius: 12px; }
.f-note svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--accent); }
.f-note b { color: var(--note-strong); }

[dir=rtl] .f-search { padding: 0 46px 0 16px; background-position: calc(100% - 16px) center; }
[dir=rtl] .f-close { right: auto; left: 16px; }
[dir=rtl] .f-title, [dir=rtl] .f-sub { text-align: var(--title-align); }

/* phones: full-screen, stacked; art becomes a banner on top */
@media (max-width: 520px) {
  .f-overlay { padding: 0; }
  .f-modal { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; max-width: none; padding: 0 20px 24px;
             border: 0; border-radius: 0; box-shadow: none; }
  .f-art { position: relative !important; inset: auto !important; width: calc(100% + 40px) !important; height: 150px !important;
           margin: 0 -20px 18px !important; border-radius: 0 !important; -webkit-mask-image: none !important; mask-image: none !important; }
  .f-content { flex: 1; padding: 0 !important; }
  .f-modal:not(.f-has-art) .f-content { padding-top: 56px !important; }
  .f-title { font-size: 25px; }
  .f-sub { margin-bottom: 28px; }
  .f-row { grid-template-columns: 1fr; gap: 22px; }
  .f-lead-grid { grid-template-columns: 1fr; }
  .f-tg { margin-top: 30px; }
  .f-feats { flex-direction: column; align-items: center; gap: 12px; margin-bottom: 26px; }
  .f-note { margin-top: auto; }
}

/* Design: footballer-dark - dark blue card, striker photo on the left, 1XBET logo, two fields in a row */
:root {
  --max-w: 650px; --pad: 26px 30px 24px; --title-align: left; --title-size: 27px; --art-display: block;
  --card-bg: linear-gradient(135deg, #071a47, #0b2d6d 60%, #06163a);
  --card-border: 1px solid rgba(60, 150, 255, .85); --card-shadow: 0 0 30px rgba(40, 140, 255, .5);
  --page-bg: #07132e;
}
.f-art { top: 0; bottom: 0; left: 0; width: 235px; border-radius: var(--radius) 0 0 var(--radius);
         background: url(art/striker.jpg) center top / cover no-repeat;
         -webkit-mask-image: linear-gradient(90deg, #000 62%, transparent); mask-image: linear-gradient(90deg, #000 62%, transparent); }
.f-content { margin-left: 205px; }
.f-logo { display: block; margin-bottom: 4px; font-size: 28px; background: linear-gradient(180deg, #fff, #5db0ff);
          -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.f-sub { margin-bottom: 18px; }
.f-row { gap: 14px; }
.f-feats { display: none; }
@media (max-width: 520px) { .f-content { margin-left: 0; } }
