/* ===== Sicherheit: стиль как у Übersicht ===== */

/* шрифт секции — Inter, чтобы не пробивался "машинописный" */
#sicherheit,
#sicherheit * {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* отступы секции */
#sicherheit {
  margin-top: 20px;
  margin-bottom: 32px;
}

/* сетка 2×2 как в overview */
#sicherheit .security-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/* базовая карточка в стиле overview */
#sicherheit .security-card {
  position: relative;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, .06);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  min-height: 170px;
  overflow: hidden;
  transition: transform .14s ease, box-shadow .14s ease;
}

/* цветная полоска сверху, как в Übersicht */
#sicherheit .security-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #4f46e5, #22c55e, #0ea5e9);
}

/* hover — только для обычных карточек, не hero */
#sicherheit .security-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .10);
}

/* ===== HERO-карточка (верхняя, только заголовок) ===== */

#sicherheit .security-card--hero {
  grid-column: 1 / -1;
  min-height: 110px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#sicherheit .security-card--hero:hover {
  transform: none;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

#sicherheit .security-card--hero .sec-hero-inner {
  max-width: 540px;
}

#sicherheit .security-card--hero .sec-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.01em;
}

#sicherheit .security-card--hero .sec-subtitle {
  margin: .25rem 0 0;
  font-size: .9rem;
  color: #6b7280;
}

/* ===== Шапка обычных карточек (иконка + заголовок) ===== */

#sicherheit .sec-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

#sicherheit .sec-icon {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  background: radial-gradient(circle at 30% 20%, #f5f3ff, #dde4ff);
  box-shadow: 0 10px 20px rgba(79, 70, 229, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#sicherheit .sec-icon i {
  font-size: 1.1rem;
  color: #4338ca;
}

#sicherheit .sec-headings {
  min-width: 0;
}

#sicherheit .sec-eyebrow {
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 600;
  color: #9ca3af;
  margin-bottom: 2px;
}

#sicherheit .sec-card-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  color: #0f172a;
}

/* текст в карточках */
#sicherheit .sec-text {
  margin: 4px 0 10px;
  font-size: .9rem;
  color: #4b5563;
}

/* линия статуса под текстом (для 2FA и сессий) */
#sicherheit .sec-status-line {
  margin: 4px 0 10px;
}

/* ===== статус-бейдж 2FA (bank-like pulse) ===== */

#sicherheit .sec-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.7rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}

#sicherheit .sec-status i {
  font-size: 1.05rem;
}

/* АКТИВНО */
#sicherheit .sec-status--on {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.35),
    0 0 10px rgba(34, 197, 94, 0.30);
  animation: sec-aktiv-pulse 4.5s ease-in-out infinite;
}

/* НЕ АКТИВНО */
#sicherheit .sec-status--off {
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  box-shadow:
    0 0 0 1px rgba(220, 38, 38, 0.25),
    0 0 6px rgba(220, 38, 38, 0.15);
}

@keyframes sec-aktiv-pulse {
  0% {
    transform: scale(1);
    box-shadow:
      0 0 0 1px rgba(34, 197, 94, 0.30),
      0 0 6px rgba(34, 197, 94, 0.25);
  }
  35% {
    transform: scale(1.02);
    box-shadow:
      0 0 0 2px rgba(34, 197, 94, 0.40),
      0 0 12px rgba(34, 197, 94, 0.40);
  }
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 1px rgba(34, 197, 94, 0.30),
      0 0 6px rgba(34, 197, 94, 0.25);
  }
}

/* ===== Футер карточки: слева метрика, справа кнопка/кнопки ===== */

#sicherheit .sec-footer {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

#sicherheit .sec-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#sicherheit .sec-metric-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: #9ca3af;
}

#sicherheit .sec-metric-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: #111827;
}

/* обёртка для кнопок справа внизу карточки */
#sicherheit .sec-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* кнопки внутри футера не ломают строку */
#sicherheit .sec-footer .btn {
  white-space: nowrap;
}

/* адаптив: одна колонка на узких экранах */
@media (max-width: 900px) {
  #sicherheit .security-grid {
    grid-template-columns: 1fr;
  }
  #sicherheit .security-card--hero {
    grid-column: 1 / 2;
  }
}

/* === 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;
}
