/* استایل مشترک toast / loading / تأیید — برای صفحات auth که panel.css ندارند */
:root {
  --ui-primary: #3b66d4;
  --ui-primary-hover: #2f55b8;
  --ui-danger: #dc2626;
  --ui-success: #16a34a;
  --ui-surface: #ffffff;
  --ui-border: #e2e8f4;
  --ui-text: #0f172a;
  --ui-radius: 12px;
  --ui-shadow: 0 8px 32px rgba(30, 60, 120, 0.12);
}

#toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 360px;
}

.toast {
  padding: 0.85rem 1rem;
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  font-family: "Vazirmatn", Tahoma, system-ui, sans-serif;
  font-size: 0.9rem;
}

.toast-error { background: var(--ui-danger); color: #fff; }
.toast-success { background: var(--ui-success); color: #fff; }
.toast-info { background: var(--ui-primary); color: #fff; }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.loading-overlay.show {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--ui-border);
  border-top-color: var(--ui-primary);
  border-radius: 50%;
  animation: ui-spin 0.8s linear infinite;
}

@keyframes ui-spin {
  to { transform: rotate(360deg); }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9500;
  padding: 1rem;
}

.modal-backdrop.show {
  display: flex;
}

.ui-confirm-modal.modal {
  background: var(--ui-surface);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  max-width: 420px;
  width: 100%;
  padding: 1.5rem;
  text-align: right;
  font-family: "Vazirmatn", Tahoma, system-ui, sans-serif;
}

.ui-confirm-title {
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
  color: var(--ui-text);
}

.ui-confirm-message {
  margin: 0 0 1.35rem;
  color: var(--ui-text);
  font-size: 0.95rem;
  line-height: 1.65;
}

.ui-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.ui-confirm-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.ui-confirm-actions .btn-primary {
  background: var(--ui-primary);
  color: #fff;
}

.ui-confirm-actions .btn-secondary {
  background: #e8f0fe;
  color: var(--ui-primary);
}

.ui-confirm-actions .btn-danger {
  background: var(--ui-danger);
  color: #fff;
}

body.ui-modal-open {
  overflow: hidden;
}

.copyable {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
}

.copyable-btn {
  flex-shrink: 0;
  display: inline-flex;
  padding: 0.3rem;
  border: none;
  border-radius: 8px;
  background: #e8f0fe;
  color: var(--ui-primary);
  cursor: pointer;
}

.copyable-text {
  cursor: pointer;
  word-break: break-all;
}

.copyable-text:hover {
  color: var(--ui-primary);
  text-decoration: underline;
}
