/* ==========================================================================
   DownPortal — Modals, Dialogs, Toast Notifications & Alert Banners (Sharp & Crisp)
   ========================================================================== */

.sa-dialog {
  border: none;
  background: transparent;
  padding: 16px;
  margin: auto;
  max-width: 440px;
  width: 100%;
}

.sa-dialog--wide {
  max-width: 520px;
}

.sa-dialog::backdrop {
  background: rgba(9, 13, 22, 0.75);
}

.sa-dialog-box {
  background: var(--ui-surface);
  border-radius: var(--ui-radius-sm);
  overflow: hidden;
  border: 1.5px solid var(--ui-color-border-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.sa-dialog-box.is-bookmarks-modal { max-width: 580px; }
.sa-dialog-box.is-auth-modal { max-width: 380px; margin: 0 auto; }
.sa-dialog-box.is-report-modal { max-width: 440px; margin: 0 auto; }

.sa-dialog-header {
  padding: 14px 18px;
  background: var(--ui-surface-subtle);
  border-bottom: 1px solid var(--ui-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sa-dialog-header h3,
.sa-dialog-header__title {
  font-size: var(--type-title-md-size, 16px);
  font-weight: 800;
  color: var(--ui-color-text-strong);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: var(--ui-space-2);
}

.sa-dialog-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--ui-radius-xs);
  color: var(--ui-text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 2px 8px;
  transition: all 0.12s ease;
}

.sa-dialog-close-btn:hover {
  background: var(--ui-surface-muted);
  border-color: var(--ui-border);
  color: var(--ui-text-strong);
}

.sa-dialog-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-list-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-2);
  max-height: 380px;
  overflow-y: auto;
}

.modal-dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ui-space-2);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ui-border);
}

.modal-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.modal-form-actions .btn {
  flex: 1;
}

/* Auth Dialog Tabs */
.auth-nav-tabs {
  display: flex;
  border-bottom: 1px solid var(--ui-border);
  background: var(--ui-surface-subtle);
}

.auth-nav-tab {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  color: var(--ui-text-muted);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.12s ease;
}

.auth-nav-tab:hover {
  color: var(--ui-text-strong);
}

.auth-nav-tab.is-active {
  color: var(--ui-action);
  border-bottom-color: var(--ui-action);
  background: var(--ui-surface);
}

.auth-tab-pane {
  display: none;
}

.auth-tab-pane.is-active {
  display: block;
}

/* Modal Form Controls */
.modal-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.modal-form-label {
  font-size: 12px;
  font-weight: 750;
  color: var(--ui-text-strong);
}

.modal-form-input,
.modal-form-select,
.modal-form-textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ui-text-strong);
  background: var(--ui-surface);
  border: 1.5px solid var(--ui-color-border-strong);
  border-radius: var(--ui-radius-xs);
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.12s ease;
}

.modal-form-input:focus,
.modal-form-select:focus,
.modal-form-textarea:focus {
  border-color: var(--ui-action);
  outline: 1.5px solid var(--ui-action);
  outline-offset: -1px;
}

.modal-form-input[readonly] {
  background: var(--ui-surface-subtle);
}

.modal-form-hint {
  font-size: 11.5px;
  color: var(--ui-text-muted);
  margin-top: 2px;
}

/* Toast Notifications */
.toast-container,
.sa-toast-wrap {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item,
.sa-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #090d16;
  color: #ffffff;
  border-radius: var(--ui-radius-xs);
  border: 1px solid #1e293b;
  font-size: 13px;
  font-weight: 650;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.2s ease;
  max-width: 340px;
}

.toast-item.is-success,
.sa-toast.is-success {
  border-left: 4px solid var(--semantic-success);
}

.toast-item.is-danger,
.sa-toast.is-danger {
  border-left: 4px solid var(--semantic-danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Report Modal Specifics */
.report-notice-banner {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: var(--ui-radius-xs);
  padding: 10px 12px;
  font-size: 12.5px;
  color: #991b1b;
  line-height: 1.45;
  margin-bottom: 8px;
}
