/* Shared phone + plate fields (fields.js). Light by default; a dark page sets the --bxf-* variables
   (e.g. body.dark { --bxf-bg:#1d1d1d; --bxf-ink:#fff; --bxf-line:#3a3a3a; --bxf-mute:#9a9a9a; --bxf-ph:#5a5a5a; --bxf-key:#262626 }).
   The plate itself stays white with a black frame on any page: that is what a real plate looks like. */
.bxf {
  --_bg: var(--bxf-bg, #fff); --_ink: var(--bxf-ink, #111); --_line: var(--bxf-line, #d6d6db); --_mute: var(--bxf-mute, #6e6e73);
  --_ph: var(--bxf-ph, #c4c4ca); --_key: var(--bxf-key, #f1f1f3); --_red: #e3262b;
  display: block; margin: 0 0 18px; font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
.bxf-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 4px 8px; font-size: 13px; font-weight: 600; color: var(--_mute); }
.bxf-cap em { font-style: normal; font-weight: 500; font-size: 12px; opacity: .85; }
.bxf-msg { display: block; min-height: 18px; margin: 8px 4px 0; font-size: 13px; line-height: 1.35; color: var(--_mute); transition: color .2s; }
.bxf.bad .bxf-msg { color: var(--_red); }

/* phone: [+7 | 917 123-45-67 ✓] */
.bxf-box {
  position: relative; display: flex; align-items: center; height: 60px; padding: 0 44px 0 0; border-radius: 14px;
  background: var(--_bg); border: 1.5px solid var(--_line); cursor: text; transition: border-color .2s, box-shadow .2s;
}
.bxf-box:focus-within { border-color: var(--_ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--_ink) 9%, transparent); }
.bxf.bad .bxf-box { border-color: var(--_red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--_red) 12%, transparent); }
.bxf-pre {
  flex: none; align-self: stretch; display: grid; place-items: center; padding: 0 14px 0 16px; margin-right: 12px;
  font: 700 21px/1 'Inter Tight', 'Inter', sans-serif; color: var(--_ink); border-right: 1.5px solid var(--_line);
}
.bxf-box input {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--_ink);
  font: 600 21px/1 'Inter Tight', 'Inter', sans-serif; letter-spacing: .02em; font-variant-numeric: tabular-nums;
}
.bxf-box input::placeholder { color: var(--_ph); }
.bxf-box::after, .bxp::after {
  content: '✓'; position: absolute; right: 16px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%;
  display: grid; place-items: center; background: var(--_ink); color: var(--_bg); font: 800 13px/1 'Inter', sans-serif;
  transform: scale(0); opacity: 0; transition: transform .28s cubic-bezier(.3, 1.6, .5, 1), opacity .2s; pointer-events: none;
}
.bxp::after { right: -34px; }
.bxf.ok .bxf-box::after, .bxf-plate.ok .bxp::after { transform: scale(1); opacity: 1; }

/* plate: [А][000][АА] | [116 / RUS ▭] */
.bxp {
  position: relative; display: inline-flex; align-items: stretch; height: 66px; max-width: calc(100% - 36px); border: 2.5px solid #111; border-radius: 10px; background: #fff; color: #111;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .07); transition: box-shadow .2s, border-color .2s; cursor: text;
}
.bxf-plate.focus .bxp { box-shadow: 0 0 0 4px color-mix(in srgb, var(--_ink) 12%, transparent), 0 8px 24px rgba(0, 0, 0, .08); }
.bxf-plate.bad .bxp { border-color: var(--_red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--_red) 14%, transparent); }
.bxp-main { display: flex; align-items: center; gap: 1px; padding: 0 8px 0 10px; }
.bxp-reg { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 8px; border-left: 2.5px solid #111; min-width: 62px; cursor: text; }
.bxp-s {
  box-sizing: content-box; height: 46px; padding: 0 2px; margin: 0; border: 0; outline: 0; border-radius: 7px; background: transparent; color: #111;
  font: 700 34px/46px 'Inter Tight', 'Inter', sans-serif; text-align: center; text-transform: uppercase; font-variant-numeric: tabular-nums;
  caret-color: var(--_red); transition: background .15s;
}
.bxp-s::placeholder { color: #cfcfd4; }
.bxp-s.l1 { width: .95em; font-size: 30px; }
.bxp-s.d3 { width: 2.05em; }
.bxp-s.l2 { width: 1.85em; font-size: 30px; }
.bxp-s.rg { width: 2.15em; height: 38px; font-size: 24px; line-height: 38px; }
/* an empty region says «регион» in small letters: a grey «116» looked like a region already typed in */
.bxp-s.rg::placeholder { font: 600 11px/38px 'Inter', sans-serif; letter-spacing: .02em; text-transform: none; color: #8e8e93; }
.bxp-s.cur { background: #efeff2; }
.bxp-s.need { box-shadow: inset 0 0 0 2px var(--_red); }
.bxp-rus { display: flex; align-items: center; gap: 3px; margin-top: 1px; font: 700 9px/1 'Inter', sans-serif; letter-spacing: .1em; color: #111; }
.bxp-rus i { display: none; }

/* letters strip under the plate while a letter part is active: tap instead of hunting on the keyboard */
.bxp-keys { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 12px; max-width: 360px; }
.bxp-keys[hidden] { display: none; }
.bxp-keys button {
  height: 42px; border: 0; border-radius: 10px; background: var(--_key); color: var(--_ink); cursor: pointer;
  font: 700 18px/1 'Inter Tight', 'Inter', sans-serif; touch-action: manipulation; transition: transform .1s, background .15s;
}
.bxp-keys button:active { transform: scale(.94); background: color-mix(in srgb, var(--_key) 80%, var(--_ink)); }

.bxf.shake .bxf-box, .bxf.shake .bxp { animation: bxf-shake .38s cubic-bezier(.36, .07, .19, .97); }
@keyframes bxf-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .bxf.shake .bxf-box, .bxf.shake .bxp { animation: none; } .bxf-box::after { transition: none; } }
@media (max-width: 340px) {
  .bxp-s { font-size: 30px; } .bxp-s.l1, .bxp-s.l2 { font-size: 26px; } .bxp-s.rg { font-size: 21px; }
  .bxp-reg { min-width: 54px; padding: 0 6px; }
}
