/**
 * Client Security — SSH keys (Hostinger-inspired)
 * Accent: Boxis #000e9c
 */
.bx-ssh-page {
  --bx-ssh-accent: #000e9c;
  --bx-ssh-accent-soft: #eef2ff;
  --bx-ssh-border: #e5e7eb;
  --bx-ssh-muted: #6b7280;
  --bx-ssh-text: #111827;
  --bx-ssh-radius: 0.85rem;
}

.bx-ssh-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin: 0 0 1rem;
}

.bx-ssh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 2.5rem;
  padding: 0 1.1rem;
  border-radius: 0.55rem;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bx-ssh-btn-primary {
  background: var(--bx-ssh-accent);
  border-color: var(--bx-ssh-accent);
  color: #fff !important;
}

.bx-ssh-btn-primary:hover {
  background: #0018a8;
  border-color: #0018a8;
  color: #fff !important;
}

.bx-ssh-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--bx-ssh-accent) !important;
}

.bx-ssh-btn-ghost:hover {
  background: var(--bx-ssh-accent-soft);
}

.bx-ssh-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3.25rem 1.5rem;
  border: 1px solid var(--bx-ssh-border);
  border-radius: var(--bx-ssh-radius);
  background: #fff;
}

.bx-ssh-empty-icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: #f3f4f6;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1.15rem;
  position: relative;
}

.bx-ssh-empty-icon .bx-ssh-key-badge {
  position: absolute;
  right: -0.15rem;
  bottom: -0.1rem;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--bx-ssh-border);
  color: var(--bx-ssh-accent);
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bx-ssh-empty-title {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--bx-ssh-text);
}

.bx-ssh-empty-desc {
  margin: 0 0 1.35rem;
  color: var(--bx-ssh-muted);
  font-size: 0.925rem;
  max-width: 26rem;
}

.bx-ssh-empty .bx-ssh-btn-primary {
  margin-bottom: 0.85rem;
}

.bx-ssh-help-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--bx-ssh-accent) !important;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none !important;
}

.bx-ssh-help-link:hover {
  text-decoration: underline !important;
}

.bx-ssh-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bx-ssh-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--bx-ssh-border);
  border-radius: 0.75rem;
  background: #fff;
}

.bx-ssh-card-icon {
  flex: 0 0 2.4rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.55rem;
  background: var(--bx-ssh-accent-soft);
  color: var(--bx-ssh-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bx-ssh-card-body {
  flex: 1 1 auto;
  min-width: 0;
}

.bx-ssh-card-name {
  font-weight: 650;
  color: var(--bx-ssh-text);
  font-size: 0.95rem;
  margin: 0 0 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bx-ssh-card-fp {
  margin: 0;
  color: var(--bx-ssh-muted);
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bx-ssh-card-actions {
  flex: 0 0 auto;
}

.bx-ssh-card-actions .btn {
  border-radius: 0.45rem;
}

/* Modal */
.bx-ssh-modal .modal-dialog {
  max-width: 42rem;
}

.bx-ssh-modal.bx-ssh-modal-wide .modal-dialog {
  max-width: 56rem;
}

.bx-ssh-modal .modal-content {
  border: 1px solid var(--bx-ssh-border);
  border-radius: 1rem;
  box-shadow: 0 18px 50px rgba(17, 24, 39, 0.12);
  overflow: hidden;
}

.bx-ssh-modal .modal-header {
  border: 0;
  padding: 1.35rem 1.35rem 0.35rem;
}

.bx-ssh-modal .modal-title {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--bx-ssh-text);
}

.bx-ssh-modal-sub {
  margin: 0.15rem 0 0;
  color: var(--bx-ssh-muted);
  font-size: 0.9rem;
}

.bx-ssh-modal .modal-body {
  padding: 1rem 1.35rem 0.5rem;
}

.bx-ssh-modal .modal-footer {
  border: 0;
  padding: 0.75rem 1.35rem 1.25rem;
  gap: 0.5rem;
}

.bx-ssh-field {
  position: relative;
  margin: 0 0 1.1rem;
}

.bx-ssh-field > label {
  position: absolute;
  left: 0.85rem;
  top: -0.55rem;
  padding: 0 0.35rem;
  background: #fff;
  color: var(--bx-ssh-text);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  z-index: 1;
}

.bx-ssh-field > label .req {
  color: #dc2626;
  margin-left: 0.1rem;
}

.bx-ssh-field > input,
.bx-ssh-field > textarea {
  width: 100%;
  border: 1px solid var(--bx-ssh-border);
  border-radius: 0.65rem;
  padding: 0.85rem 0.95rem;
  font-size: 0.925rem;
  color: var(--bx-ssh-text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  resize: vertical;
}

.bx-ssh-field > textarea {
  min-height: 9.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
}

.bx-ssh-field > input:focus,
.bx-ssh-field > textarea:focus {
  border-color: var(--bx-ssh-accent);
  box-shadow: 0 0 0 3px rgba(0, 14, 156, 0.12);
}

.bx-ssh-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .bx-ssh-layout.is-split {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 0;
  }

  .bx-ssh-layout.is-split .bx-ssh-form-col {
    padding-right: 1.25rem;
    border-right: 1px solid var(--bx-ssh-border);
  }

  .bx-ssh-layout.is-split .bx-ssh-guide-col {
    padding-left: 1.25rem;
  }
}

.bx-ssh-guide-title {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--bx-ssh-text);
}

.bx-ssh-guide-intro {
  margin: 0 0 1rem;
  color: var(--bx-ssh-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.bx-ssh-step {
  display: flex;
  gap: 0.7rem;
  margin: 0 0 1rem;
}

.bx-ssh-step-num {
  flex: 0 0 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--bx-ssh-accent-soft);
  color: var(--bx-ssh-accent);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

.bx-ssh-step-body {
  flex: 1 1 auto;
  min-width: 0;
}

.bx-ssh-step-body > p {
  margin: 0 0 0.45rem;
  font-size: 0.875rem;
  color: var(--bx-ssh-text);
}

.bx-ssh-code {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f3f4f6;
  border-radius: 0.55rem;
  padding: 0.65rem 0.75rem;
  margin: 0 0 0.35rem;
}

.bx-ssh-code code {
  flex: 1 1 auto;
  font-size: 0.75rem;
  color: var(--bx-ssh-text);
  word-break: break-all;
  white-space: pre-wrap;
}

.bx-ssh-code-copy {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--bx-ssh-muted);
  cursor: pointer;
  padding: 0.2rem;
}

.bx-ssh-code-copy:hover {
  color: var(--bx-ssh-accent);
}

.bx-ssh-step-note {
  margin: 0;
  font-size: 0.75rem;
  color: var(--bx-ssh-muted);
}

/* Hide legacy misplaced Add SSH on IP tab */
.section-ipaccess > a.btn[href="#addssh"] {
  display: none !important;
}

[data-theme="dark"] .bx-ssh-empty,
[data-theme="dark"] .bx-ssh-card,
[data-theme="dark"] .bx-ssh-field > input,
[data-theme="dark"] .bx-ssh-field > textarea,
[data-theme="dark"] .bx-ssh-modal .modal-content {
  background: #1f2937;
  border-color: #374151;
  color: #f3f4f6;
}

[data-theme="dark"] .bx-ssh-field > label {
  background: #1f2937;
  color: #e5e7eb;
}

[data-theme="dark"] .bx-ssh-empty-title,
[data-theme="dark"] .bx-ssh-card-name,
[data-theme="dark"] .bx-ssh-modal .modal-title,
[data-theme="dark"] .bx-ssh-guide-title,
[data-theme="dark"] .bx-ssh-step-body > p {
  color: #f9fafb;
}

[data-theme="dark"] .bx-ssh-code {
  background: #111827;
}

[data-theme="dark"] .bx-ssh-empty-icon {
  background: #111827;
}
