:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1b2430;
  --muted: #4a5568;
  --accent: #0b6e5c;
  --accent-text: #ffffff;
  --border: #c9d1da;
  --input-bg: #ffffff;
  --error: #b42318;
  --ok: #0b6e4f;
  --focus: #0b6e5c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --card: #1a222c;
    --text: #f2f5f7;
    --muted: #b8c2cc;
    --accent: #3fc1a6;
    --accent-text: #0b1a16;
    --border: #3a4654;
    --input-bg: #121920;
    --error: #ff8a80;
    --ok: #6ee7b7;
    --focus: #6ee7b7;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}

.top { display: flex; justify-content: flex-end; min-height: 40px; }

.lang { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }

.lang-btn {
  min-height: 40px;
  min-width: 56px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.lang-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }

.card {
  background: var(--card);
  border-radius: 16px;
  padding: 24px 20px;
  margin-top: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

h1 { font-size: 26px; line-height: 1.25; margin: 0 0 12px; }

.lead { margin: 0 0 20px; color: var(--text); }

.field-label { display: block; font-weight: 600; margin-bottom: 8px; }

.code-input {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 28px;
  letter-spacing: 0.3em;
  text-align: center;
}

.code-input:focus-visible,
.btn:focus-visible,
.lang-btn:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.btn {
  display: block;
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn:disabled { opacity: 0.6; cursor: default; }

.btn.primary { background: var(--accent); color: var(--accent-text); }

.btn.link {
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  min-height: 44px;
  margin-top: 8px;
}

.status { margin: 12px 0 0; font-size: 16px; }
.status.error { color: var(--error); font-weight: 600; }
.status.ok { color: var(--ok); font-weight: 600; }

.fine { margin: 20px 0 0; font-size: 14px; color: var(--muted); }

[hidden] { display: none !important; }
