/* ===== Sicherheit — специфика секции ===== */

/* Привязка к секции */
#sicherheit { }

/* === Login / Forgot / Set-Password: компактные поля === */
#sicherheit form input.form-control,
#sicherheit form select.form-select {
  font-size: .9rem;          /* текст чуть меньше */
  line-height: 1.2;
  padding: .28rem .65rem;     /* вертикальный паддинг ↓ => поле ниже */
  height: auto;               /* сбрасываем фиксированную высоту bootstrap */
  min-height: 30px;           /* общая минимальная высота */
  max-width: 320px;           /* ширина, как и хотели */
  border-radius: 12px;
  border: 1px solid #c3cff8;
  background: #fff;
}

/* фокус без ореола */
#sicherheit form input.form-control:focus,
#sicherheit form select.form-select:focus {
  border-color: #6366f1;
  box-shadow: none !important;
  outline: 0;
}
/* обёртка поля пароля */
.auth-pass {
  position: relative;
}

/* само поле — как у остальных инпутов */
.auth-pass .form-control {
  padding-right: 3rem; /* место под кнопочку справа */
}

/* кнопка-глазик */
.auth-pass #toggle-password {
  position: absolute;
  top: 50%;
  right: 0.8rem;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: #f3f4ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

/* сама иконка */
.auth-pass #toggle-password i {
  font-size: 1.1rem;
  line-height: 1;
  color: #6b7280;
}

/* небольшой hover-эффект */
.auth-pass #toggle-password:hover {
  background: #e0e7ff;
}

/* ==== Aktive Sitzungen page ( /security/sessions ) ==== */

.sec-sessions-page {
  margin-top: 24px;
  margin-bottom: 40px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* внутренняя колонка — чтобы и hero, и карточка были уже и по центру */
.sec-sessions-inner {
  max-width: 920px;      /* уже, чем вся страница */
  margin: 0 auto;
}

/* HERO как заглавие страницы */
.sec-page-hero {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.12);
  padding: 22px 24px 18px;
  border-top: 4px solid #22c55e;
  margin-bottom: 16px;
}

.sec-page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sec-page-subtitle {
  margin: 6px 0 14px;
  font-size: 0.94rem;
  color: #6b7280;
}

/* маленькие счётчики */
.sec-page-stats {
  display: flex;
  gap: 16px;
}

.sec-page-stats .stat-item {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f9fafb;
  border: 1px solid rgba(148, 163, 184, 0.4);
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.stat-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #9ca3af;
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
}

/* ВТОРАЯ КАРТОЧКА — ПОУЖЕ, список сессий */
.sec-page-card {
  max-width: 860px;          /* ещё немного уже, чем hero */
  margin: 0 auto;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.14);
  padding: 18px 20px 16px;
}

/* Список и отдельная карточка, в стиле trusted devices */
.session-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.session-card {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  padding: 14px 14px 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #f9fafb;
}

.session-card--current {
  border-color: #4f46e5;
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.15);
}

.session-card-main {
  display: flex;
  gap: 12px;
}

.session-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  background: radial-gradient(circle at 30% 20%, #eef2ff, #d4d4ff);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.session-card-icon i {
  font-size: 1.2rem;
  color: #4338ca;
}

.session-card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.session-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 0.8rem;
}

.session-meta-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  color: #9ca3af;
  margin-right: 4px;
}

.session-meta-value {
  font-weight: 500;
  color: #4b5563;
}

.session-card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-left: 12px;
}

/* статусные бейджи */
.badge-session {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-session--on {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.badge-session--off {
  background: rgba(148, 163, 184, 0.18);
  color: #4b5563;
}

.session-status-text {
  margin-top: 4px;
  font-size: 0.8rem;
  color: #6b7280;
}

.session-actions .btn {
  white-space: nowrap;
}

/* Низ карточки */
.session-card-footer {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed rgba(148, 163, 184, 0.7);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

/* Адаптив */
@media (max-width: 768px) {
  .sec-sessions-inner {
    padding: 0 10px;
  }

  .sec-page-card {
    padding: 14px 12px 12px;
  }

  .session-card {
    flex-direction: column;
  }

  .session-card-side {
    align-items: flex-start;
    margin-left: 0;
    margin-top: 8px;
  }

  .session-card-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .session-card-footer .btn {
    width: 100%;
  }
}
/* ==== /security/sessions – FINAL mobile override ==== */
@media (max-width: 768px) {
  /* сам секшен – чуть сузить от края */
  #security-sessions-page.sec-sessions-page {
    padding-inline: 12px;
  }

  /* hero и карточка со списком – компактнее */
  #security-sessions-page .sec-page-hero,
  #security-sessions-page .sec-page-card {
    border-radius: 18px;
    padding: 14px 12px 12px;
  }

  /* каждая сессия – вертикальная колонка */
  #security-sessions-page .session-card {
    flex-direction: column !important;
    align-items: stretch;
  }

  #security-sessions-page .session-card-side {
    align-items: flex-start;
    margin-left: 0;
    margin-top: 8px;
  }

  /* футер с кнопками – одна под другой, на всю ширину */
  #security-sessions-page .session-card-footer {
    flex-direction: column;
    align-items: stretch;
  }

  #security-sessions-page .session-card-footer .btn,
  #security-sessions-page .session-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Modale: generelles Layout */
.security-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.55);

  /* Жёстко ограничиваем по вьюпорту */
  width: 100vw;
  height: 100vh;
  box-sizing: border-box;
  overflow-y: auto; /* если по высоте не влазит – скролл внутри оверлея */
}

.security-modal.is-open {
  display: flex;
}

.security-modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
  box-sizing: border-box;

  /* ширина: максимум 520px, но не больше вьюпорта */
  max-width: 520px;
  width: 100%;
  margin: auto;
}

/* Mobile: Modale soll nicht breiter als der Screen sein */
@media (max-width: 576px) {
  .security-modal {
    padding: 0.75rem;
  }

  .security-modal-box {
    max-width: 100%;
    width: 100%;
    margin: auto;
    border-radius: 10px;
    padding: 1rem 1rem 1.1rem;
  }
}

/* Kleine optische Dinge */
.sec-consent-version {
  font-size: 0.9rem;
  font-weight: 600;
}

.security-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.security-modal-actions .btn {
  flex: 1 1 auto;
  min-width: 120px;
  text-align: center;
}
