/* css/shared/modal.css
   FCS Bid — Shared Modal Component Styles (Phase 9.5.2)
   Styles for the programmatic FCS_Modal system (js/shared/ui/fcs_modal.js).
   All values reference var(--fcs-*) tokens from tokens.css.
   ─────────────────────────────────────────────────────────────────────── */

/* ── Backdrop ── */
.fcs-modal-backdrop-overlay {
  position: fixed;
  inset: 0;
  background: var(--fcs-color-backdrop);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--fcs-space-5);
  box-sizing: border-box;

  /* Animate in */
  opacity: 0;
  transition: opacity var(--fcs-transition-fast);
}

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

/* ── Dialog ── */
.fcs-modal-dialog {
  background: var(--fcs-color-surface);
  border-radius: var(--fcs-radius-lg);
  box-shadow: var(--fcs-shadow-modal);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  width: 100%;
  box-sizing: border-box;

  /* Animate in */
  transform: translateY(-8px) scale(0.98);
  transition: transform var(--fcs-transition-fast), opacity var(--fcs-transition-fast);
  opacity: 0;
}

.fcs-modal-backdrop-overlay.fcs-modal--visible .fcs-modal-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Size variants */
.fcs-modal-dialog--sm { max-width: var(--fcs-modal-width-sm); }
.fcs-modal-dialog--md { max-width: var(--fcs-modal-width-md); }
.fcs-modal-dialog--lg { max-width: var(--fcs-modal-width-lg); }

/* ── Header ── */
.fcs-modal-hdr {
  background: var(--fcs-color-primary);
  padding: var(--fcs-space-3) var(--fcs-space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--fcs-space-3);
  flex-shrink: 0;
}

.fcs-modal-hdr__title {
  font-family: var(--fcs-font-family);
  font-size: var(--fcs-font-size-lg);
  font-weight: var(--fcs-font-weight-bold);
  color: var(--fcs-color-text-inverse);
  margin: 0;
  line-height: 1.3;
}

.fcs-modal-hdr__close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--fcs-radius-sm);
  transition: background var(--fcs-transition-fast), color var(--fcs-transition-fast);
  flex-shrink: 0;
  font-family: var(--fcs-font-family);
}

.fcs-modal-hdr__close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--fcs-color-text-inverse);
}

/* ── Body ── */
.fcs-modal-bdy {
  padding: var(--fcs-space-5);
  overflow-y: auto;
  flex: 1;
  font-family: var(--fcs-font-family);
  font-size: var(--fcs-font-size-body);
  color: var(--fcs-color-text);
}

/* ── Footer ── */
.fcs-modal-ftr {
  padding: var(--fcs-space-3) var(--fcs-space-5) var(--fcs-space-5);
  display: flex;
  gap: var(--fcs-space-2);
  justify-content: flex-end;
  flex-shrink: 0;
  border-top: 1px solid var(--fcs-color-border-light);
}

/* ── Footer Buttons ── */
.fcs-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--fcs-space-2) var(--fcs-space-5);
  font-family: var(--fcs-font-family);
  font-size: var(--fcs-font-size-body);
  font-weight: var(--fcs-font-weight-bold);
  border-radius: var(--fcs-radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--fcs-transition-fast), border-color var(--fcs-transition-fast), color var(--fcs-transition-fast);
  white-space: nowrap;
  line-height: 1;
  min-height: 36px;
}

.fcs-modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fcs-modal-btn--primary {
  background: var(--fcs-color-primary);
  border-color: var(--fcs-color-primary);
  color: var(--fcs-color-text-inverse);
}

.fcs-modal-btn--primary:hover:not(:disabled) {
  background: var(--fcs-color-primary-hover);
  border-color: var(--fcs-color-primary-hover);
}

.fcs-modal-btn--secondary {
  background: transparent;
  border-color: var(--fcs-color-primary);
  color: var(--fcs-color-primary);
}

.fcs-modal-btn--secondary:hover:not(:disabled) {
  background: var(--fcs-color-primary-light);
}

.fcs-modal-btn--danger {
  background: var(--fcs-color-danger);
  border-color: var(--fcs-color-danger);
  color: var(--fcs-color-text-inverse);
}

.fcs-modal-btn--danger:hover:not(:disabled) {
  background: var(--fcs-color-danger-hover);
  border-color: var(--fcs-color-danger-hover);
}
