/* ==========================================================================
   MODAL.CSS
   Styles for the generic modal component (js/components/modal.js).
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  z-index: 200;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.modal-overlay.modal-visible {
  opacity: 1;
}

.modal-box {
  background: var(--ink-raised);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  padding: var(--space-lg);
  box-shadow: var(--shadow-soft);
  transform: scale(0.96);
  transition: transform var(--transition-base);
}

.modal-overlay.modal-visible .modal-box {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.modal-header h3 {
  font-size: 17px;
}

.modal-close {
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  padding: 4px;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: var(--space-md);
}

.modal-input-group {
  margin-bottom: var(--space-md);
}

.modal-input-group label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

/* Big, bold, bordered box — deliberately larger than a normal text field
   so it reads as a distinct, important "enter your secret here" box,
   similar to how wallet apps present passphrase entry. */
.modal-input-group input,
.modal-input-group textarea {
  width: 100%;
  min-height: 64px;
  background: var(--surface);
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  color: var(--text);
  font-size: 17px;
  font-family: var(--font-mono);
  transition: border-color var(--transition-fast);
  resize: none;
}

.modal-input-group textarea {
  min-height: 190px;
  line-height: 1.7;
  font-size: 18px;
}

.modal-input-group input::placeholder,
.modal-input-group textarea::placeholder {
  color: var(--text-faint);
}

.modal-input-group input:focus,
.modal-input-group textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.modal-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: -8px;
  margin-bottom: var(--space-md);
  display: none;
}

.modal-error.visible {
  display: block;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.modal-actions .btn {
  width: 100%;
}

/* ---- LIGHT THEME VARIANT ----
   Used when showModal() is called with { theme: 'light' } — currently
   just the Seller Verification passphrase popup. Redefining these
   variables here is enough to recolor the whole modal, since every
   modal style below already reads from var(--surface), var(--text),
   var(--primary), etc. rather than hardcoded colors. */
.modal-theme-light {
  --surface: #FFFFFF;
  --surface-hover: #F3F1FE;
  --surface-border: #E4E1FB;
  --ink-raised: #FFFFFF;
  --text: #1A1A1A;
  --text-muted: #6B6B6B;
  --text-faint: #9B9B9B;
  --primary: #6C5CE7;
  --primary-hover: #7C6EEB;
  --primary-dim: #4B3FD9;
  --danger: #D6304A;
  --shadow-glow: 0 0 24px rgba(108, 92, 231, 0.25);
  --shadow-soft: 0 12px 32px rgba(75, 63, 217, 0.2);
}

.modal-disclaimer {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: var(--space-md);
  line-height: 1.6;
}