.dialog-auth-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.dialog-auth-overlay.active {
  display: flex;
}

.dialog-auth {
  display: flex;
  flex-direction: column;
  background-color: #343137;
  padding: 30px;
  border-radius: 10px;
  font-weight: bold;
  max-width: 460px;
  width: 90%;
}

.dialog-auth span,
.dialog-auth p {
  color: #f0f0f0b7;
}

.dialog-header {
  font-size: 1.4rem;
  align-self: center;
  margin-bottom: 10px;
}

.dialog-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
}

.dialog-text {
  font-size: 0.9rem;
  padding: 0;
  margin-bottom: 10px;
}

/* ---- Destination / Callback boxes ---- */

.dialog-auth-dest-tab {
  display: flex;
  background-color: #1e1d22;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  padding: 8px 20px;
  align-items: center;
  justify-content: space-between;
}

.dialog-auth-dest-content {
  display: flex;
  background-color: #25232a;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  align-items: center;
}

.dialog-auth-dest-txt,
.dialog-auth-callback-txt {
  display: flex;
  flex: 1;
  background-color: #25232a;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  padding: 10px;
  font-size: 0.8rem;
  justify-content: center;
  color: #f0f0f0 !important;
  word-break: break-all;
  min-height: 1.2em;
}

.btn-copy-dest,
.btn-copy-callback {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 15px;
  cursor: pointer;
}

/* ---- QR code display ---- */

.dialog-challenge-qr-wrap {
  display: flex;
  justify-content: center;
  padding: 5px 0;
}

#dialog-challenge-qr {
  background: white;
  padding: 15px;
  border-radius: 8px;
  display: inline-block;
  line-height: 0;
}

/* ---- Challenge status area ---- */

.dialog-challenge-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 4px 10px;
}

.dialog-challenge-status-txt {
  font-size: 0.85rem;
  color: #f0f0f0b7 !important;
}

/* Spinner */
.dialog-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #f0f0f030;
  border-top-color: #4f7b46;
  border-radius: 50%;
  animation: dialog-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes dialog-spin {
  to { transform: rotate(360deg); }
}

/* ---- Collapsible callback details ---- */

.dialog-callback-details {
  font-size: 0.8rem;
}

.dialog-callback-details summary {
  cursor: pointer;
  color: #f0f0f060;
  text-align: center;
  padding: 2px 0;
  user-select: none;
}

.dialog-callback-details summary:hover {
  color: #f0f0f0a0;
}

.dialog-callback-details[open] summary {
  margin-bottom: 8px;
}

/* ---- Mode toggle link ---- */

.dialog-mode-toggle {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  color: #f0f0f060;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: #f0f0f030;
  transition: color 0.15s;
}

.dialog-mode-toggle:hover {
  color: #f0f0f0a0;
}

/* ---- Paste box (manual mode) ---- */

.dialog-auth-paste-box {
  background-color: #1e1d22;
  border-radius: 5px;
  height: 160px;
  padding: 10px;
  overflow: auto;
  outline: none;
  font-family: monospace;
  font-size: 0.85rem;
  color: #f0f0f0;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---- Buttons ---- */

.dialog-row {
  display: flex;
  gap: 20px;
}

.dialog-btn {
  display: flex;
  flex: 1;
  color: #f0f0f0;
  border: none;
  border-radius: 5px;
  padding: 15px;
  font-size: 1.1rem;
  font-weight: bold;
  justify-content: center;
  cursor: pointer;
}

.btn-cancel {
  background-color: #7b4646;
}

.btn-confirm {
  background-color: #4f7b46;
}

.btn-confirm:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}