/* Базовый сброс и шрифты */
*, *::before, *::after {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: #111;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
               "Segoe UI", Roboto, "Arial", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Контейнер страницы */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
}

/* Логотип справа сверху */
.brand {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: #111;
}
.brand-mark {
  font-size: 16px;
}

/* Основной блок-карточка */
.card {
  width: 100%;
  max-width: 440px;
  margin-top: 88px;
}

/* Кнопка "назад" вверху слева */
.back {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  color: #555;
  font-size: 15px;
  cursor: pointer;
  padding: 4px;
}
.back:hover {
  color: #111;
}

/* Заголовки */
h1 {
  font-size: 36px;
  line-height: 1.15;
  font-weight: 700;
  margin: 0 0 12px 0;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 12px 0;
  letter-spacing: -0.02em;
}
p {
  margin: 0 0 24px 0;
  color: #6b6b6b;
  font-size: 15px;
}
.muted {
  color: #6b6b6b;
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 56px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  font-family: inherit;
  text-decoration: none;
  box-sizing: border-box;
}
.btn + .btn {
  margin-top: 12px;
}
.btn-primary {
  background: #111;
  color: #fff;
  border-color: #111;
}
.btn-primary:hover {
  background: #000;
}
.btn-secondary {
  background: #fff;
  color: #111;
  border-color: #d6d6d6;
}
.btn-secondary:hover {
  border-color: #999;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ===== Карточки сессий ===== */
.session-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.session-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 20px;
  border: 1px solid #d6d6d6;
  border-radius: 12px;
  background: #fff;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  color: #111;
  cursor: default;
  position: relative;
  transition: transform 0.10s cubic-bezier(.2,.8,.2,1), box-shadow 0.10s ease;
}
.session-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.10);
}
/* неподтверждённая сессия — пунктирная рамка */
.session-card--pending {
  border-style: dashed;
  border-color: #c4c4c4;
  background: #fafaf9;
}
.session-card-content {
  flex: 1;
  min-width: 0;
}
/* строка иконка + (имя+email): центрируется ТОЛЬКО по этим строкам,
   статус ниже её не сдвигает */
.id-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.session-card-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: #6b6b6b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.session-card-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}
.id-text {
  flex: 1;
  min-width: 0;
}
.session-card-name {
  font-weight: 600;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-card-email {
  font-size: 13px;
  color: #6b6b6b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
/* email как основной элемент (когда имени нет) */
.session-card-email-main {
  font-size: 15px;
  font-weight: 500;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* статус под id-row, с отступом под текст (не под иконку) */
.session-card-sub {
  font-size: 13px;
  color: #999;
  margin-top: 10px;
  padding-left: 38px;
}
/* кликабельный email (неверифицированный) — ведёт на верификацию.
   Без визуального выделения самого email: статус сигнализирует
   пунктирная карточка, а не подчёркивание текста. */
.session-card-email--link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
/* компактная кнопка действия в карточке (Выйти) — мгновенный hover */
.session-card-action {
  width: auto;
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  margin: 0;
  flex-shrink: 0;
  align-self: center;
  transition: none;
}
.session-card-action:hover {
  border-color: #111;
  background: #f6f6f6;
}
/* кликабельная карточка целиком (выбор аккаунта в auth_request) */
.session-card--clickable {
  cursor: pointer;
}
.session-card-arrow {
  font-size: 18px;
  color: #999;
  align-self: center;
  flex-shrink: 0;
}

/* Разделитель "или" */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: #999;
  font-size: 14px;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #ececec;
}
.divider span {
  padding: 0 14px;
}

/* Поля ввода */
.field {
  margin-bottom: 12px;
}
.field-label {
  display: block;
  font-size: 14px;
  color: #6b6b6b;
  margin-bottom: 6px;
}
.input {
  display: block;
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 1px solid #d6d6d6;
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  color: #111;
  background: #fff;
  outline: none;
  transition: border-color 0.12s;
}
.input::placeholder {
  color: #b0b0b0;
}
.input:focus {
  border-color: #555;
}

/* Карточка-info (например про passkey) */
.info-card {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: #f4f4f4;
  border-radius: 12px;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.45;
}
.info-card-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #111;
  margin-top: 2px;
}
.info-card-title {
  font-weight: 600;
  color: #111;
  margin-bottom: 4px;
}
.info-card-body {
  color: #6b6b6b;
}

/* Сообщения статуса (ошибка/успех) */
.status {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  display: none;
}
.status.show {
  display: block;
}
.status.error {
  background: #fff0f0;
  color: #b00020;
}
.status.success {
  background: #effaf3;
  color: #006c2c;
}
.status.info {
  background: #f4f4f4;
  color: #444;
}

/* Ссылки-underlined */
.text-link {
  display: inline-block;
  text-align: center;
  margin-top: 20px;
  width: 100%;
  background: none;
  border: 0;
  color: #111;
  text-decoration: underline;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
}

/* Управление сессиями (low-key ссылка снизу) */
.manage-sessions-link {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: #6b6b6b;
  font-size: 14px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

/* Сноска внизу страницы (для согласия) */
.footer-note {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 440px;
  width: calc(100% - 48px);
  color: #b0b0b0;
  font-size: 13px;
  text-align: center;
  line-height: 1.45;
}

/* Поле ввода кода — крупное центрированное */
.code-input {
  display: block;
  width: 100%;
  height: 72px;
  padding: 0;
  text-align: center;
  font-size: 32px;
  letter-spacing: 8px;
  font-weight: 500;
  border: 1px solid #d6d6d6;
  border-radius: 12px;
  background: #fff;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  outline: none;
  margin-bottom: 16px;
}
.code-input:focus {
  border-color: #555;
}

/* Демо/completed страницы — таблицы */
.info-block {
  background: #f4f4f4;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 16px 0 24px 0;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
}
.info-row + .info-row {
  border-top: 1px solid #e8e8e8;
}
.info-label {
  color: #6b6b6b;
  flex-shrink: 0;
}
.info-row code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  background: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  color: #111;
  word-break: break-all;
  text-align: right;
}

/* Адаптив для мобильных */
@media (max-width: 480px) {
  .page {
    padding: 16px;
  }
  .card {
    max-width: 100%;
    margin-top: 72px;
  }
  h1, h2 {
    font-size: 28px;
  }
  .brand {
    top: 16px;
    right: 16px;
  }
  .back {
    top: 16px;
    left: 16px;
  }
  .footer-note,
  .manage-sessions-link {
    width: calc(100% - 32px);
  }
}
