/* ─── Вход и Профиль · вёрстка один в один по макетам Stitch ───────────────
   tb-10-vhod.html и tb-04-profil.html. Числа взяты из макета:
   display-lg 32/40 -0.02em 700 · headline-md 20/28 -0.01em 600 ·
   headline-sm 16/24 600 · body-md 14/20 400 · body-sm 13/18 400 ·
   label-md 12/16 500 · label-caps 11/16 +0.05em 600.
   Радиусы: lg 8px, xl 12px, default 4px. Файл грузится после app.css. */

/* ─── Иконки, добавленные под эти два экрана ─── */
.ico-user      { --u: url('/static/icons/user.svg'); }
.ico-lock      { --u: url('/static/icons/lock-simple.svg'); }
.ico-briefcase { --u: url('/static/icons/briefcase.svg'); }
.ico-star      { --u: url('/static/icons/star-fill.svg'); }
.ico-trend     { --u: url('/static/icons/trend-up.svg'); }
.ico-checkc    { --u: url('/static/icons/check-circle.svg'); }
.ico-clipboard { --u: url('/static/icons/clipboard-text.svg'); }
.ico-copy      { --u: url('/static/icons/copy.svg'); }
.ico-tg        { --u: url('/static/icons/paper-plane-tilt.svg'); }

/* ══════════════════════════ ВХОД ══════════════════════════════════════ */
/* макет: слева форма на половину экрана, справа полотно-картинка (lg+) */
.login-body {
  display: flex; align-items: stretch;
  min-height: 100vh; min-height: 100dvh;
  font-family: var(--n-sans);
  background: var(--n-canvas);                 /* surface-container-lowest */
  color: var(--ink);
  font-size: 14px;
}
.login-pane {
  width: 100%; display: flex; flex-direction: column;
  padding: 32px 24px;                  /* py-8 px-container-margin */
}
.login-top { padding-top: 16px; margin-bottom: auto; }
.login-brand {
  font-size: 20px; line-height: 28px; letter-spacing: -0.01em;
  font-weight: 700; color: var(--accent);
}
.login-brand::before { content: none; }   /* точку из app.css макет не рисует */
.login-main {
  width: 100%; max-width: 448px;       /* max-w-md */
  margin: auto; display: flex; flex-direction: column; gap: 12px;
}
.login-head { margin-bottom: 24px; }
.login-head h1 {
  font-size: 32px; line-height: 40px; letter-spacing: -0.02em;
  font-weight: 700; color: var(--ink); margin-bottom: 8px;
}
.login-head p { font-size: 14px; line-height: 20px; color: var(--body); }
.login-form { display: flex; flex-direction: column; gap: 16px; width: 100%; }
/* поле: заливка полотна, рамка прозрачная, на фокусе акцент + кольцо бренда */
.login-field {
  position: relative; width: 100%; border-radius: 12px;
  background: var(--field); border: 1px solid transparent;
  display: flex; align-items: center; padding: 12px 16px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.login-field:focus-within { border-color: var(--accent); box-shadow: var(--n-focus); }
.login-field .ico { width: 20px; height: 20px; margin-right: 12px; color: var(--faint); }
.login-field input {
  width: 100%; background: transparent; border: 0; outline: none; padding: 0;
  font: inherit; font-size: 14px; line-height: 20px; color: var(--ink);
}
.login-field input::placeholder { color: var(--line); }
.login-form button[type="submit"] {
  margin-top: 8px; width: 100%; border: 0; cursor: pointer;
  background: var(--accent-deep); color: #fff;
  font: inherit; font-size: 16px; line-height: 24px; font-weight: 600;
  padding: 12px 0; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--n-lift-2);
  transition: background .18s var(--ease);
}
.login-form button[type="submit"]:hover { background: var(--accent); }
.login-form button[type="submit"]:active { opacity: .8; }
.login-error {
  font-size: 13px; line-height: 18px; font-weight: 600; color: var(--red);
  text-align: center;
}
.login-error:empty { display: none; }
.login-alt { margin-top: 16px; text-align: center; }
.login-alt span, .login-hint {
  font-size: 13px; line-height: 18px; color: var(--faint);
}
.login-foot {
  margin-top: auto; padding-bottom: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.login-foot p {
  font-size: 13px; line-height: 18px; color: var(--n-meta); text-align: center;
}
.login-links { display: flex; gap: 16px; }
.login-links a {
  font-size: 11px; line-height: 16px; letter-spacing: .05em; font-weight: 600;
  color: var(--body); text-decoration: none;
  transition: color .18s var(--ease);
}
.login-links a:hover { color: var(--accent); }
/* правое полотно вместо картинки из макета: свой градиент, внешних файлов нет */
.login-art { display: none; }

@media (min-width: 640px) { .login-pane { padding-left: 48px; padding-right: 48px; } }
@media (min-width: 768px) { .login-pane { padding-left: 96px; padding-right: 96px; } }
@media (min-width: 1024px) {
  .login-pane { width: 50%; }
  .login-art {
    display: block; width: 50%; position: relative; overflow: hidden;
    background:
      radial-gradient(120% 90% at 12% 8%, rgba(33,160,56,.85) 0%, rgba(33,160,56,0) 55%),
      radial-gradient(90% 80% at 88% 88%, rgba(19,124,42,.9) 0%, rgba(19,124,42,0) 60%),
      linear-gradient(160deg, #0d5c1f 0%, #137c2a 55%, #21a038 100%);
  }
  /* мягкая сетка поверх заливки, гаснет к краям */
  .login-art::before {
    content: ''; position: absolute; inset: 0;
    background:
      repeating-linear-gradient(0deg, rgba(255,255,255,.06) 0 1px, transparent 1px 48px),
      repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 1px, transparent 1px 48px);
    -webkit-mask: radial-gradient(70% 60% at 50% 45%, #000 0%, transparent 100%);
    mask: radial-gradient(70% 60% at 50% 45%, #000 0%, transparent 100%);
  }
  /* словесный знак во всю ширину, обрезан нижним краем — приём с лендинга */
  .login-word {
    position: absolute; left: 50%; bottom: -6%; transform: translateX(-50%);
    font-size: clamp(88px, 11vw, 190px); line-height: .78;
    font-weight: 600; letter-spacing: .02em; white-space: nowrap;
    color: rgba(255,255,255,.14); user-select: none; z-index: 1;
  }
  .login-word i { font-style: normal; color: rgba(255,255,255,.5); }
  /* блик — тот же приём, что и в карточке профиля */
  .login-art::after {
    content: ''; position: absolute; width: 420px; height: 420px;
    left: 55%; top: 18%; border-radius: 50%;
    background: rgba(255,255,255,.22); filter: blur(64px);
  }
}

/* ══════════════════════════ ПРОФИЛЬ ═══════════════════════════════════ */
.pf { max-width: 1024px; margin: 0 auto; width: 100%; }
.pf-head { margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; }
.pf-head h2 {
  font-size: 32px; line-height: 40px; letter-spacing: -0.02em;
  font-weight: 700; color: var(--ink);
}
.pf-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.pf-left, .pf-right { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* общая карточка макета: белая, r12, p16, тень xs, рамка surface-variant */
.pf-card {
  background: var(--panel); border: 1px solid var(--surface-variant);
  border-radius: 12px; padding: 16px; box-shadow: var(--shadow-xs);
}

/* ─── Шапка профиля ─── */
.pf-hero { position: relative; overflow: hidden; }
.pf-glow {
  position: absolute; top: 0; right: 0; width: 256px; height: 256px;
  border-radius: 50%; background: var(--n-signal-10); filter: blur(64px);
  transform: translate(25%, -50%); pointer-events: none;
}
.pf-hero-in {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: flex-start; gap: 24px;
}
.pf-ava-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pf-ava {
  position: relative; width: 128px; height: 128px; flex-shrink: 0; cursor: pointer;
}
.pf-ava-shot {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  border: 4px solid var(--panel); background: var(--surface-variant);
  box-shadow: var(--n-lift-2);
  position: relative;
}
.pf-ava .ava-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-ava .ava-fallback {
  width: 100%; height: 100%; font-size: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.pf-ava .ava-overlay {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; text-align: center;
  background: rgba(17,24,39,.55); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1.3;
  opacity: 0; transition: opacity .18s var(--ease);
}
.pf-ava:hover .ava-overlay, .pf-ava.busy .ava-overlay { opacity: 1; }
/* кружок-карандаш и бейдж уровня живут вне обрезанного круга */
.pf-ava-edit {
  position: absolute; bottom: 4px; right: 4px; width: 32px; height: 32px;
  background: var(--panel); border: 1px solid var(--surface-variant);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--accent); box-shadow: var(--n-lift-1);
  transition: background .18s var(--ease);
}
.pf-ava-edit .ico { width: 16px; height: 16px; transition: transform .18s var(--ease); }
.pf-ava:hover .pf-ava-edit { background: var(--surface-low); }
.pf-ava:hover .pf-ava-edit .ico { transform: scale(1.1); }
.ava-clear {
  border: 0; background: none; color: var(--faint); font: inherit; font-size: 12px;
  line-height: 16px; font-weight: 500; cursor: pointer; padding: 4px 8px;
  border-radius: 12px; align-self: center; margin: 0;
}
.ava-clear:hover { color: var(--red); background: var(--red-soft); }
.pf-info { flex: 1; width: 100%; min-width: 0; }
.pf-info h3 {
  font-size: 32px; line-height: 40px; letter-spacing: -0.02em; font-weight: 700;
  color: var(--ink); margin-bottom: 4px; overflow-wrap: anywhere;
}
.pf-role {
  font-size: 16px; line-height: 24px; font-weight: 600; color: var(--body);
  margin-bottom: 24px; display: flex; align-items: center; gap: 8px;
}
.pf-role .ico { width: 18px; height: 18px; }

/* ─── Плитки статистики ─── */
.pf-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pf-stat {
  display: flex; flex-direction: column; justify-content: space-between;
  align-items: flex-start; gap: 16px;
  transition: box-shadow .32s var(--ease);
}
.pf-stat:hover { box-shadow: var(--shadow-md); }
.pf-stat-ico {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.pf-stat-ico .ico { width: 20px; height: 20px; }
.pf-stat-label { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--body); margin-bottom: 4px; }
.pf-stat-val {
  font-size: 20px; line-height: 28px; letter-spacing: -0.01em; font-weight: 700;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.si-green { background: #e4f3e8; color: var(--n-cta); }
.pf-stat:hover .si-green { background: #bfe3c8; }
.si-grey { background: var(--surface-variant); color: var(--body); }
.pf-stat:hover .si-grey { background: var(--n-hairline); }
.si-orange { background: var(--n-warn-soft); color: var(--n-warn); }
.pf-stat:hover .si-orange { background: #ece2c8; }
.pf-stat-val.val-green { color: var(--n-cta); }

/* ─── Правая колонка: Telegram и пароль ─── */
.pf-side-card { display: flex; flex-direction: column; gap: 16px; }
.pf-card-head { display: flex; align-items: center; gap: 12px; }
.pf-card-head h4 { font-size: 16px; line-height: 24px; font-weight: 600; color: var(--ink); }
.pf-head-ico {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pf-head-ico .ico { width: 18px; height: 18px; }
.hi-tg { background: #0088CC; color: #fff; }
.hi-grey { background: var(--surface-variant); color: var(--body); }
.pf-note { font-size: 14px; line-height: 20px; color: var(--body); }
.pf-note b, .pf-note .accent { color: var(--accent); font-weight: 500; }
.pf-note.ok { color: var(--n-cta); font-weight: 600; }
.pf-codebox {
  background: var(--field); border: 1px solid var(--surface-variant);
  border-radius: 12px; padding: 16px; margin-top: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.pf-codebox .bind-code {
  font-size: 20px; line-height: 28px; font-weight: 700; letter-spacing: .1em;
  color: var(--ink);
}
.pf-outline {
  width: 100%; background: transparent; color: var(--accent);
  font: inherit; font-size: 16px; line-height: 24px; font-weight: 600;
  padding: 8px 16px; border-radius: 4px; border: 1px solid var(--accent);
  cursor: pointer; text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.pf-outline:hover { background: var(--surface-variant); }
.pf-outline .ico { width: 18px; height: 18px; }
.pf-outline.done { background: var(--n-signal-05); color: var(--n-cta); border-color: var(--n-cta); }
.pf-hint { font-size: 13px; line-height: 18px; color: var(--faint); text-align: center; }
.pf-form { display: flex; flex-direction: column; gap: 16px; }
.pf-field { display: flex; flex-direction: column; gap: 4px; }
.pf-field label { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--body); }
.pf-field input {
  background: var(--field); border: 0; border-radius: 12px; padding: 8px 16px;
  font: inherit; font-size: 14px; line-height: 20px; color: var(--ink);
  transition: box-shadow .18s var(--ease);
}
.pf-field input:focus { outline: none; box-shadow: 0 0 0 2px var(--accent); }
.pf-field small { font-size: 12px; line-height: 16px; color: var(--faint); }
.pf-form .pf-save {
  margin-top: 8px; align-self: stretch; border: 0; cursor: pointer;
  background: var(--accent); color: #fff;
  font: inherit; font-size: 16px; line-height: 24px; font-weight: 600;
  padding: 8px 16px; border-radius: 12px;
  box-shadow: var(--n-lift-1);
  transition: background .18s var(--ease);
}
.pf-form .pf-save:hover { background: var(--accent-deep); }
.pf-form .form-msg { font-size: 13px; line-height: 18px; font-weight: 600; }
.pf-form .form-msg:empty { display: none; }

@media (min-width: 640px) {
  .pf-hero-in { flex-direction: row; align-items: center; }
  .pf-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .pf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pf-left { grid-column: span 2; }
}
/* телефон: заголовок и имя не должны съедать экран */
@media (max-width: 520px) {
  .pf-head h2 { font-size: 26px; line-height: 34px; }
  .pf-info h3 { font-size: 26px; line-height: 34px; }
}

/* подписи плиток внутри значения: их структуру читают тесты профиля */
.pf-stat-val b { display: block; font-size: 20px; line-height: 28px; font-weight: 700; color: var(--ink); }
.pf-stat-val span { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--body); }
.pf-stat-val.val-green b { color: var(--n-cta); }
.pf-code-cap {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--body); margin-bottom: 6px;
}
