@font-face { font-family: Rubik; src: url(site-rubik-400.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Rubik; src: url(site-rubik-600.ttf) format("truetype"); font-weight: 600; font-display: swap; }

:root {
  --ink: #0F2438; --muted: #63778B; --line: #E3EAF1; --paper: #F2F6FA; --card: #FFFFFF;
  --midnight: #0A2558; --navy: #0E4486; --ocean: #1666AE; --mist: #E6F1FA;
  --ok: #178A4A; --okbg: #E3F6EB; --warn: #B8660C; --warnbg: #FEF2E2; --bad: #C8352D; --badbg: #FCE9E7;
  --shadow: 0 1px 2px rgba(10, 37, 88, .05), 0 6px 18px rgba(10, 37, 88, .07);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: Rubik, system-ui, sans-serif; font-size: 17px; line-height: 1.4; -webkit-text-size-adjust: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }
svg.i { width: 24px; height: 24px; fill: currentColor; display: block; flex: none; }

.bar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 8px; background: var(--midnight); color: #fff; padding: 11px 14px; padding-top: max(11px, env(safe-area-inset-top)); }
.bar .ttl { flex: 1; min-width: 0; font-weight: 600; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar button { background: none; border: 0; color: #fff; padding: 6px; display: flex; }
.lang { display: flex; gap: 2px; }
.lang button { padding: 5px 7px; font-size: 13px; opacity: .7; border-radius: 8px; }
.lang button.on { opacity: 1; background: rgba(255, 255, 255, .16); font-weight: 600; }
.main { max-width: 640px; margin: 0 auto; padding: 14px 14px 104px; }
.tabs { position: fixed; inset-inline: 0; bottom: 0; z-index: 4; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; border: 0; background: none; color: var(--muted); padding: 9px 2px 8px; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tabs button.on { color: var(--ocean); font-weight: 600; }

.stack > * + * { margin-top: 12px; }
.card { background: var(--card); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.card.click { cursor: pointer; display: block; width: 100%; border: 0; text-align: start; }
.card.alert { border-inline-start: 5px solid var(--warn); }
.muted { color: var(--muted); font-size: 15px; }
.title { font-size: 21px; font-weight: 600; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.code { direction: ltr; font-feature-settings: "tnum"; color: var(--muted); font-size: 15px; }
.chip { display: inline-block; border-radius: 999px; padding: 4px 10px; font-size: 14px; font-weight: 600; background: var(--mist); color: var(--navy); }
.chip.warn { background: var(--warnbg); color: var(--warn); }
.chip.ok { background: var(--okbg); color: var(--ok); }
.chip.sig { background: var(--badbg); color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 58px; border: 0; border-radius: 16px; background: var(--ocean); color: #fff; font-weight: 600; font-size: 19px; padding: 12px; }
.card > .btn { margin-top: 10px; }
.btn.alt { background: var(--card); color: var(--navy); border: 1px solid var(--line); min-height: 52px; font-size: 17px; }
.btn.small { min-height: 42px; font-size: 15px; width: auto; padding: 8px 16px; border-radius: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.pair { display: flex; gap: 10px; }
.pair > * { flex: 1; }

.now { background: var(--mist); border-radius: 18px; padding: 16px; }
.now b { display: block; font-size: 28px; color: var(--navy); font-weight: 600; line-height: 1.2; }
.msg { border-radius: 14px; padding: 12px 14px; font-weight: 600; }
.msg.ok { background: var(--okbg); color: var(--ok); }
.msg.bad { background: var(--badbg); color: var(--bad); }
.msg.info { background: var(--mist); color: var(--navy); }
.msg.warn { background: var(--warnbg); color: var(--warn); }

.scan { position: relative; border-radius: 18px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scan video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan .frame { position: absolute; inset: 16%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 18px; }
.scan.hit { box-shadow: inset 0 0 0 6px var(--ok); }
.scan.miss { box-shadow: inset 0 0 0 6px var(--bad); }
.result { display: flex; align-items: center; gap: 10px; }

.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 5px 0; color: var(--muted); }
.steps li i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.steps li.done { color: var(--ink); }
.steps li.done i { background: var(--ocean); border-color: var(--ocean); }
.steps li.cur { color: var(--ocean); font-weight: 600; }
.steps li.cur i { background: #fff; border: 5px solid var(--ocean); }

label { display: block; font-size: 15px; color: var(--muted); margin: 10px 0 5px; }
input[type=text], input[type=password], input[type=number], textarea { width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 13px; background: #fff; }
textarea { min-height: 76px; resize: vertical; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 16px; }
.pick button.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.thumb { width: 92px; height: 92px; border-radius: 12px; object-fit: cover; margin-top: 10px; display: block; }
input[type=file] { display: none; }

.door { min-height: 100vh; display: grid; place-items: center; padding: 22px 16px; background: linear-gradient(150deg, var(--midnight), var(--navy) 55%, var(--ocean)); }
.door .box { width: 100%; max-width: 400px; background: var(--card); border-radius: 26px; padding: 30px 24px 18px; text-align: center; }
.door img { width: 84px; height: 84px; border-radius: 50%; }
.door h1 { font-size: 24px; margin: 10px 0 2px; font-weight: 600; }
.door form { text-align: start; margin-top: 8px; }
.door .btn { margin-top: 14px; }
.door .err { color: var(--bad); font-size: 15px; margin-top: 8px; min-height: 22px; text-align: center; }
.door .lang { justify-content: center; margin-top: 8px; }
.door .lang button { color: var(--muted); background: none; border: 0; }
.door .lang button.on { background: var(--mist); color: var(--navy); }
.off { background: var(--bad); color: #fff; text-align: center; padding: 8px; font-weight: 600; font-size: 15px; }
