/* Вход ВКонтакте — точная копия vk.ru (2026). Значения сняты с реальной страницы. */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --text: #e1e3e6;              /* rgb(225,227,230) — текст VKUI */
  --muted: rgb(144,146,148);    /* серый подзаголовок VK */
  --blue: rgb(82,158,244);      /* ссылки VKUI (dark) */
  --card: rgb(25,25,26);        /* фон карточки и верхней панели */
  --field: #232324;             /* поля/табы */
  --search: rgb(42,42,43);      /* фон поиска */
  --outline: rgba(255,255,255,.12); /* обводка secondary-кнопок */
  --border: #3a3a3c;
  --error: #ff6b6b;
}

html { background: #0a0a0a; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: linear-gradient(111.34deg, #1a1a1a 0%, #0a0a0a 100%) fixed;
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bg-decor {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

/* ---------- верхняя панель: 48px, сплошной фон, padding 0 48 0 32 ---------- */
.topbar {
  position: relative; z-index: 2;
  height: 48px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px 0 32px;
  gap: 12px;
  background: var(--card);
}
.search-box {
  position: relative;
  display: flex; align-items: center;
  width: 233px; height: 32px;
  background: var(--search);
  border-radius: 8px;
  padding-left: 34px;
  color: rgb(185,186,191);
}
.search-box > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.search-box input {
  flex: 1; height: 100%;
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 15px; font-family: inherit;
  padding-right: 10px;
}
.search-box input::placeholder { color: rgb(185,186,191); }
.search-box input::-webkit-search-cancel-button { filter: invert(.7); }

.biz-btn {
  height: 28px; padding: 0 16px;
  background: transparent; color: var(--text);
  font-size: 13.33px; font-family: inherit; font-weight: 400;
  border: none; border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--outline);
  cursor: pointer;
  white-space: nowrap;
}
.biz-btn:hover { box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }

/* ---------- центр: карточка по центру, «Помощь» в 24px под ней ---------- */
.stage {
  flex: 1;
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 16px 0;
  gap: 24px;
  min-height: 0;
}

.view { display: none; width: 100%; max-width: 360px; }
.view.active { display: block; }

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 28px;
  width: 100%;
  position: relative;
}
.card--qr { padding: 28px 44px; }
.card > :last-child { margin-bottom: 0; }

/* ---------- QR: 188px, радиус 20 ---------- */
.qr-box {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 10px;
  width: 188px; height: 188px;
  margin: 0 auto 16px;
}
#qrCanvas, #qrCanvas svg { width: 100%; height: 100%; display: block; border-radius: 12px; }
.qr-logo {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 10px;
  box-shadow: 0 0 0 4px #fff;
  line-height: 0;
}

/* ---------- типографика ---------- */
.logo-big { text-align: center; margin-bottom: 16px; line-height: 0; }

.title {
  font-size: 20px; font-weight: 500;
  line-height: 24px;
  text-align: center;
  color: var(--text);
  margin-bottom: 16px;
}
.card--qr .title { margin-bottom: 8px; }
.subtitle {
  font-size: 15px; color: var(--muted);
  line-height: 20px;
  text-align: center;
  white-space: nowrap;
}
.blue-link {
  display: flex; align-items: center; justify-content: center;
  height: 28px;
  color: var(--blue); text-decoration: none;
  font-size: 13px; font-weight: 500; line-height: 16px;
  margin-bottom: 20px;
}
.blue-link:hover { text-decoration: underline; }

/* ---------- табы (segmented control) ---------- */
.tabs {
  display: flex; background: var(--field);
  border-radius: 8px; padding: 2px; margin-bottom: 16px;
  height: 36px;
}
.tab {
  flex: 1; font-size: 14px; font-weight: 500; line-height: 20px;
  background: transparent; color: var(--text);
  border: none; border-radius: 8px; cursor: pointer;
  transition: background .15s;
  font-family: inherit;
}
.tab.active {
  background: rgb(98,99,100);
  box-shadow: 0 4px 8px rgba(0,0,0,.15), 0 0 4px rgba(0,0,0,.2);
}

/* ---------- поля ---------- */
.field {
  position: relative;
  display: flex; align-items: center;
  background: var(--field);
  border-radius: 8px;
  margin-bottom: 0;
  padding: 0 12px 0 4px;
  height: 36px;
}
.field[hidden] { display: none; }
.field:focus-within { box-shadow: inset 0 0 0 2px var(--blue); }
.field input {
  flex: 1; height: 100%;
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 15px;
  font-family: inherit;
  line-height: 20px;
  padding: 0;
  caret-color: var(--blue);
}
.field input::placeholder { color: #6a6a6c; }

.flag {
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  width: 28px; height: 28px;
  margin-right: 8px;
  background: rgba(255,255,255,.1);
  border-radius: 6px;
}
.flag svg { border-radius: 50%; }
.prefix { font-size: 15px; margin-right: 6px; color: var(--text); font-family: inherit; }

/* ---------- чекбокс ---------- */
.save-login {
  display: flex; align-items: center; gap: 12px;
  font-size: 15px; line-height: 20px; color: var(--text);
  height: 44px; margin: 0 0 4px; cursor: pointer; user-select: none;
  padding-left: 16px; margin-left: -16px;
}
.save-login input { display: none; }
.checkmark {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--blue);
  line-height: 0;
}
.checkmark .off { display: none; }
.save-login input:not(:checked) + .checkmark .on { display: none; }
.save-login input:not(:checked) + .checkmark .off { display: block; }
.save-login input:not(:checked) + .checkmark { color: rgb(137,139,141); }
.qmark {
  width: 16px; height: 16px; border-radius: 50%;
  background: #48484a; color: var(--muted);
  font-size: 11px; display: flex; align-items: center; justify-content: center;
}

/* ---------- кнопки ---------- */
.btn-primary {
  width: 100%; height: 36px;
  background: #fff; color: #000;
  font-size: 13.33px; font-weight: 400;
  border: none; border-radius: 8px;
  cursor: pointer; margin-bottom: 12px;
  font-family: inherit;
}
.btn-primary:active { background: #dcdcdc; }
.btn-primary:disabled { opacity: .6; }

/* secondary — прозрачная с обводкой, как у VKUI */
.btn-secondary {
  width: 100%; height: 36px;
  background: transparent; color: var(--text);
  font-size: 13.33px; font-weight: 400;
  border: none; border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--outline);
  cursor: pointer; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit;
}
.btn-secondary:hover { box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }

.divider {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: 16px; margin: 17px 0;
  color: var(--muted); font-size: 13px; line-height: 16px;
}
.divider::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: rgb(54,55,56);
}
.divider span { position: relative; background: var(--card); padding: 0 20px; }

.qr-btn { font-size: 15px; font-weight: 500; gap: 8px; margin: 18px 0 0; }

.legal {
  font-size: 11px; line-height: 14px; color: rgb(185,186,191);
  text-align: center; margin-top: 16px;
}
.legal a { color: rgb(185,186,191); }

/* поле + кнопка (экраны пароля и кода) */
.field + .btn-primary { margin-top: 16px; }

/* стрелка «назад» на экранах пароля/кода */
.back {
  position: absolute;
  top: 13px; left: 13px;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: rgb(137,139,141);
  border-radius: 50%;
}
.back:hover { background: rgba(255,255,255,.06); }

.center-link {
  display: block; text-align: center;
  color: var(--muted); font-size: 14px;
  text-decoration: none; margin-top: 16px;
}

/* ---------- Помощь ---------- */
.help {
  color: #fff; font-size: 13px; font-weight: 500; line-height: 16px;
  text-decoration: underline; text-underline-offset: 3px;
  position: relative; z-index: 1;
  flex-shrink: 0;
}

/* ---------- футер (padding 12/48/24) ---------- */
.footer {
  position: relative; z-index: 1;
  padding: 12px 48px 24px;
  flex-shrink: 0;
}
.frow {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px;
  padding-bottom: 10px;
}
.frow:last-child { padding-bottom: 0; }
.fleft, .fright { display: inline-flex; flex-wrap: wrap; column-gap: 20px; row-gap: 10px; }
.fleft { max-width: 488px; }
.fright { justify-content: flex-end; }
.flink {
  color: #fff; font-size: 13px; font-weight: 400; line-height: 15px;
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: rgba(255,255,255,.45);
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer;
}
.flink:hover { text-decoration-color: rgba(255,255,255,.85); }

.error { color: var(--error); font-size: 13px; text-align: center; position: relative; z-index: 1; }

.spinner {
  position: fixed; top: 50%; left: 50%;
  width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border: 3px solid var(--border); border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  z-index: 100;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- мобильная версия ---------- */
@media (max-width: 640px) {
  body { overflow: auto; }
  .topbar { padding: 0 12px; }
  .biz-btn { display: none; }
  .search-box { width: 100%; }
  .stage { padding: 12px; gap: 20px; }
  .view { max-width: 100%; }
  .card { padding: 24px 20px; }
  .subtitle { white-space: normal; }
  .footer { padding: 12px 16px 20px; }
  .frow { flex-direction: column; align-items: flex-start; gap: 8px; }
}
