/* Ficha IA · экраны 1–3 · версия В · Naranja (design/ru|es/*.dc.html, P.naranja; design/ds/tokens.json) */

:root {
  --pt-black: #111111;
  --pt-navy: #0a206f;
  --pt-orange: #f25623;
  --pt-orange-ink: #c2410c;
  --pt-orange-soft: #f6d3c4;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --line: #dde2ee;
  --ink: #141a2e;
  --ink-muted: #4a5578;
  --on-dark: #ffffff;
  --on-dark-muted: #b8c1e0;
  --ok: #1a7f4b;
  --danger: #b42318;
  --sans: "IBM Plex Sans", "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-round: 999px;
  --tap-min: 56px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

[hidden] { display: none !important; }

a:focus-visible, button:focus-visible, input:focus-visible, label:focus-visible,
.visually-hidden:focus-visible + * {
  outline: 3px solid var(--pt-orange);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  opacity: 0;
}

/* --- экран --- */
.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--surface);
  overflow: hidden;
}

/* --- шапка: чёрная, белый логотип, оранжевая полоса 4 px --- */
.app-header {
  height: calc(58px + env(safe-area-inset-top, 0px)); /* 54 + полоса 4 px, как в макете */
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--pt-black);
  border-bottom: 4px solid var(--pt-orange);
}
.logo { height: 24px; width: auto; display: block; }
.app-header__end { display: flex; align-items: center; gap: 10px; }
.app-header__label {
  font: 500 12px/16px var(--mono);
  letter-spacing: 0.08em;
  color: var(--on-dark-muted);
  white-space: nowrap;
}
.app-header__label--accent { color: var(--pt-orange); }

/* переключатель языка: вторичная зона касания не меньше 44 px */
.lang { display: flex; align-items: center; }
.lang button {
  min-width: 44px;
  height: 44px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--on-dark-muted);
  font: 500 13px/16px var(--mono);
  letter-spacing: 0.08em;
  cursor: pointer;
}
.lang button[aria-pressed="true"] {
  color: var(--on-dark);
  text-decoration: underline;
  text-decoration-color: var(--pt-orange);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

/* --- типографика --- */
.kicker {
  font: 600 13px/18px var(--sans);
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}
.display { margin: 0; font: 700 28px/34px var(--sans); }
.lead { margin: 0; font: 400 18px/26px var(--sans); color: var(--ink-muted); }
.hint { margin: 0; font: 400 15px/22px var(--sans); color: var(--ink-muted); text-align: center; }
.hint--left { text-align: left; }
.mono { font: 500 15px/20px var(--mono); }
.mono--muted { font-size: 13px; line-height: 18px; color: var(--ink-muted); overflow-wrap: anywhere; }

/* --- кнопки --- */
.btn {
  min-height: 56px;
  width: 100%;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  font: 600 18px/24px var(--sans);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn--primary {
  min-height: 58px;
  border: 0;
  background: var(--pt-orange-ink);
  color: var(--on-dark);
}
.btn--primary:active { filter: brightness(0.9); }
.btn--primary:disabled { opacity: 0.6; cursor: progress; }
.btn--secondary {
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--pt-orange-ink);
}
.btn--small { min-height: 48px; font-size: 16px; }
.dot { width: 12px; height: 12px; border-radius: var(--radius-round); background: var(--on-dark); flex-shrink: 0; }

.alert {
  border: 2px solid var(--danger);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font: 400 16px/22px var(--sans);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.alert strong { display: block; font-weight: 600; }
.alert .btn { margin-top: 8px; }

/* --- экран 1 · вход --- */
.rings { position: absolute; right: -90px; top: 70px; pointer-events: none; }
.login {
  position: relative;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 72px 20px 24px;
}
.login__intro { display: flex; flex-direction: column; gap: 12px; max-width: 290px; }
.login__title { margin: 0; font: 700 30px/36px var(--sans); }
.login__form { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.code-input {
  height: 64px;
  width: 100%;
  border-radius: var(--radius-md);
  border: 2px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font: 500 28px/32px var(--mono);
  letter-spacing: 0.2em;
  text-align: center;
}
.code-input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { margin: 0; font: 600 15px/20px var(--sans); color: var(--danger); text-align: center; }
.login__form .hint { margin-top: 4px; }
.login__footer {
  padding: 0 20px 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  font: 500 12px/16px var(--mono);
  color: var(--ink-muted);
}

/* --- экраны 2 и 3 --- */
.page {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 20px 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
}
.page--record { gap: 22px; }
.page__head { display: flex; flex-direction: column; gap: 6px; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; padding: 8px 0; }
.steps__num {
  width: 40px; height: 40px;
  border-radius: var(--radius-round);
  border: 3px solid var(--pt-orange);
  display: flex; align-items: center; justify-content: center;
  font: 500 16px/20px var(--mono);
  color: var(--pt-orange-ink);
}
.steps__text { display: flex; flex-direction: column; }
.steps__text strong { font: 600 18px/24px var(--sans); }
.steps__text span { font: 400 15px/20px var(--sans); color: var(--ink-muted); }

.example {
  margin: 0;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.example blockquote { margin: 0; font: 400 18px/26px var(--sans); }

.actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }

/* кнопка записи — кольца знака PT */
.rec { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0; }
.rec__button {
  width: 168px; height: 168px;
  border-radius: var(--radius-round);
  border: 3px solid var(--pt-orange);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.rec__ring2 {
  width: 136px; height: 136px;
  border-radius: var(--radius-round);
  border: 3px solid var(--pt-orange-soft);
  display: flex; align-items: center; justify-content: center;
}
.rec__core {
  width: 96px; height: 96px;
  border-radius: var(--radius-round);
  background: var(--pt-orange-ink);
  display: flex; align-items: center; justify-content: center;
}
.rec__dot { width: 34px; height: 34px; border-radius: var(--radius-round); background: var(--on-dark); }
.rec__button:active .rec__core { filter: brightness(0.9); }
.rec__caption { font: 600 18px/24px var(--sans); }
#camera-input:focus-visible ~ .rec .rec__button,
#gallery-input:focus-visible ~ .btn--secondary { outline: 3px solid var(--pt-orange); outline-offset: 2px; }

.upload {
  margin-top: auto;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.upload__top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.upload__top strong { font: 600 17px/22px var(--sans); }
.upload--done .upload__top strong { color: var(--ok); }
.bar { height: 10px; border-radius: var(--radius-round); background: var(--line); overflow: hidden; }
.bar__fill {
  width: 0;
  height: 10px;
  border-radius: var(--radius-round);
  background: var(--pt-orange);
  transition: width 0.3s ease;
}
.upload--done .bar__fill { background: var(--ok); }
