/* Security settings page — extends dashboard shell */

:root {
  --sec-purple: var(--dash-accent);
  --sec-purple-soft: var(--dash-surface-hover);
  --sec-card-elevated: var(--dash-elevated);
  --sec-border: rgba(255, 255, 255, 0.08);
  --sec-text: #f4f4f5;
  --sec-right-w: 320px;
  --sec-success: #22c55e;
  --sec-warning: #f59e0b;
  --sec-danger: #ef4444;
}

body.sec-page {
  --dash-purple: var(--sec-purple);
  --dash-purple-soft: var(--sec-purple-soft);
}

.sec-page .dash-new-btn,
.sec-page .dash-pro__btn,
.sec-page .sec-btn--primary {
  background: var(--sec-purple);
}

.sec-page .dash-pro__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.sec-page .dash-search input:focus {
  border-color: var(--dash-border-strong);
  box-shadow: 0 0 0 3px var(--dash-surface-hover);
}

.sec-page .sec-review-header {
  border: none;
}

.sec-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}



/* Layout */
.sec-content {
  padding: var(--dash-content-y, 32px) var(--dash-page-x, 32px);
  padding-left: calc(var(--dash-page-x, 32px) + var(--dash-mobile-nav-gutter, 0px));
  padding-bottom: calc(var(--dash-content-y, 32px) + var(--dash-content-pad-bottom, 0px));
  flex: 1;
  min-width: 0;
  container: sec-content / inline-size;
}

.sec-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sec-right-w);
  gap: 24px;
  align-items: start;
}

.sec-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.sec-aside {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-block-start: 82px;
  position: sticky;
  top: 24px;
}

.sec-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--dash-text-muted);
}

.sec-crumb a {
  color: var(--dash-text-muted);
  text-decoration: none;
  transition: color 150ms ease;
}

.sec-crumb a:hover { color: var(--sec-purple); }

.sec-crumb__sep { opacity: 0.5; }

.sec-crumb [aria-current="page"] { color: var(--sec-text); }

.sec-title {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--sec-text);
}

.sec-subtitle {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--dash-text-muted);
  line-height: 1.45;
}

/* Cards */
.sec-card {
  background: var(--dash-card);
  border: none;
  border-radius: 20px;
  box-shadow: var(--dash-shadow);
  overflow: hidden;
  transition: box-shadow 150ms ease;
}

.sec-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
}

.sec-card__title {
  margin: 0;
  padding: 20px 20px 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--sec-text);
}

.sec-card__head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
}

.sec-card__head-row .sec-card__title {
  padding: 0;
}

.sec-card__foot {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--sec-border);
  margin-top: 4px;
}

.sec-card__foot--split {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Key-value rows (password) */
.sec-kv-rows {
  padding: 12px 12px 4px;
}

.sec-kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 8px;
  border-radius: 12px;
  transition: background 150ms ease;
}

.sec-kv-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sec-kv-row__label {
  font-size: 15px;
  color: var(--sec-text);
}

.sec-kv-row__value {
  font-size: 13px;
  color: var(--dash-text-muted);
}

.sec-kv-row__value--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
}

/* 2FA grid */
.sec-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px 20px 8px;
}

.sec-kv-item {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--sec-card-elevated);
  border: none;
}

.sec-kv-item__label {
  display: block;
  font-size: 13px;
  color: var(--dash-text-muted);
  margin-bottom: 4px;
}

.sec-kv-item__value {
  font-size: 15px;
  font-weight: 500;
  color: var(--sec-text);
}

/* Badges */
.sec-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.sec-badge--success {
  background: rgba(34, 197, 94, 0.14);
  color: var(--sec-success);
}

.sec-badge--warning {
  background: rgba(245, 158, 11, 0.14);
  color: var(--sec-warning);
}

.sec-badge--muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--dash-text-muted);
}

.sec-badge--current {
  background: var(--sec-purple-soft);
  color: var(--sec-purple);
}

.sec-badge--trusted {
  background: rgba(34, 197, 94, 0.14);
  color: var(--sec-success);
}

.sec-badge--lg {
  padding: 6px 14px;
  font-size: 13px;
}

/* Tables */
.sec-card--table .sec-card__title {
  padding-bottom: 12px;
}

.sec-table-wrap {
  overflow-x: auto;
  padding: 0 8px 8px;
}

.sec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.sec-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dash-text-muted);
  border-bottom: 1px solid var(--sec-border);
}

.sec-table td {
  padding: 14px 12px;
  color: var(--sec-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.sec-table tbody tr {
  transition: background 150ms ease;
}

.sec-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sec-table tbody tr:last-child td {
  border-bottom: none;
}

.sec-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--dash-text-muted);
}

.sec-device {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sec-device__icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--sec-purple-soft);
  color: var(--sec-purple);
  flex-shrink: 0;
}

.sec-device__name {
  font-weight: 500;
}

.sec-session-device__name {
  display: block;
  font-weight: 500;
  font-size: 14px;
}

.sec-session-device__meta {
  display: block;
  font-size: 12px;
  color: var(--dash-text-muted);
  margin-top: 2px;
}

.sec-menu-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--dash-text-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 150ms ease, color 150ms ease;
}

.sec-menu-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--sec-text);
}

/* Recovery link rows */
.sec-link-rows {
  padding: 4px 8px 8px;
}

.sec-link-row {
  display: grid;
  grid-template-columns: 32px 1fr auto 16px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease;
}

.sec-link-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sec-link-row__icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--sec-purple-soft);
  color: var(--sec-purple);
}

.sec-link-row__label {
  font-size: 15px;
  color: var(--sec-text);
}

.sec-link-row__value {
  font-size: 13px;
  color: var(--dash-text-muted);
}

.sec-link-row__chev {
  color: var(--dash-text-muted);
}

.sec-card__copy,
.sec-status {
  margin: 6px 0 0;
  color: var(--dash-text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.sec-card__foot .sec-status {
  width: 100%;
}

.sec-passkeys-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.sec-passkeys-list .settings-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--dash-border);
}

.sec-passkeys-list .settings-account-text {
  color: var(--sec-text);
  font-size: 14px;
}

.sec-passkeys-list .settings-account-disconnect-link {
  color: var(--dash-text-muted);
  font-size: 13px;
  text-decoration: none;
}

.sec-passkeys-list .settings-account-disconnect-link:hover {
  color: var(--sec-text);
}

/* Buttons */
.sec-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 14px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.sec-btn--primary { color: #fff; }

.sec-btn--primary:hover:not(:disabled) {
  box-shadow: 0 0 20px var(--dash-border-strong);
}

.sec-btn--secondary {
  background: var(--sec-card-elevated);
  border: none;
  color: var(--sec-text);
}

.sec-btn--secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.sec-btn--ghost {
  background: transparent;
  border: none;
  color: var(--dash-text-muted);
}

.sec-btn--ghost:hover:not(:disabled) {
  color: var(--sec-text);
  background: rgba(255, 255, 255, 0.04);
}

.sec-btn--ghost:disabled {
  opacity: 0.4;
  cursor: default;
}

.sec-btn--danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--sec-danger);
}

.sec-btn--danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
}

.sec-btn--sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 10px;
}

.sec-btn--block { width: 100%; }

.sec-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: #151515;
  color: var(--sec-text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.sec-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
}

.sec-dialog__panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
}

.sec-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sec-dialog__head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0;
}

.sec-dialog__close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--sec-text);
  cursor: pointer;
  font: inherit;
  font-size: 20px;
}

.sec-dialog__copy {
  margin: 0;
  color: var(--dash-text-muted);
  font-size: 14px;
  line-height: 1.45;
}

.sec-dialog__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--dash-text-muted);
  font-size: 13px;
}

.sec-dialog__input {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--sec-text);
  font: inherit;
  padding: 0 14px;
  outline: none;
}

.sec-dialog__input:focus {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.sec-dialog__error {
  margin: 0;
  color: var(--sec-danger);
  font-size: 13px;
}

.sec-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.sec-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  max-width: min(320px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 999px;
  background: #f5f5f5;
  color: #111;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.sec-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.is-security-locked .sec-card,
.is-security-locked .sec-panel:not(.sec-panel--danger) {
  filter: saturate(0.85);
}

/* Right panel */
.sec-panel {
  background: var(--dash-card);
  border: none;
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--dash-shadow);
  transition: box-shadow 150ms ease;
}

.sec-panel:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
}

.sec-panel--hero {
  text-align: center;
}

.sec-panel--danger {
  border-color: rgba(239, 68, 68, 0.2);
}

.sec-panel__title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--sec-text);
}

.sec-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.sec-panel__head .sec-panel__title {
  margin-bottom: 0;
}

.sec-panel__copy {
  margin: -8px 0 16px;
  font-size: 13px;
  color: var(--dash-text-muted);
  line-height: 1.45;
}

/* Security score ring */
.sec-score {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 16px;
}

.sec-score__ring {
  width: 100%;
  height: 100%;
}

.sec-score__ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.sec-score__center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.sec-score__pct {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--sec-text);
}

.sec-score-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.sec-score-meta__rec {
  margin: 0;
  font-size: 13px;
  color: var(--dash-text-muted);
}

/* Activity list */
.sec-activity {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sec-activity__row {
  display: grid;
  grid-template-columns: 28px 1fr auto 14px;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 4px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease;
}

.sec-activity__row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sec-activity__icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--dash-text-muted);
}

.sec-activity__label {
  font-size: 14px;
  color: var(--sec-text);
}

.sec-activity__time {
  font-size: 12px;
  color: var(--dash-text-muted);
}

.sec-activity__chev {
  color: var(--dash-text-muted);
}

.sec-link-btn {
  display: inline-flex;
  margin-top: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--dash-text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 150ms ease;
}

.sec-link-btn:hover { color: var(--sec-purple); }

/* Recommendations */
.sec-recs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sec-rec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 12px;
  transition: background 150ms ease;
}

.sec-rec:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sec-rec__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.sec-rec__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--sec-text);
}

.sec-emergency-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Search hide */
.sec-card.is-hidden {
  display: none;
}

@container sec-content (max-width: 1040px) {
  .sec-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sec-aside {
    position: static;
    margin-block-start: 0;
  }
}

@container sec-content (max-width: 620px) {
  .sec-title {
    font-size: 28px;
  }

  .sec-table {
    min-inline-size: 680px;
  }
}

/* Keep authentication details legible beside the mobile navigation rail. */
@container sec-content (max-width: 420px) {
  .sec-kv-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
