/* ══ Modal Overlay ══ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay[hidden] { display: none; }

.modal-box {
  background: #0f1340;
  border-radius: 16px;
  padding: 32px;
  width: min(480px, 90vw);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: eg2ModalIn 0.2s ease;
}
@keyframes eg2ModalIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.2s;
}
.modal-close:hover { color: #fff; }

/* Tabs */
.modal-tabs {
  display: flex;
  border-bottom: 1px solid #1a1d3a;
  margin-bottom: 24px;
}
.modal-tab {
  background: none;
  border: none;
  color: #aaa;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-size: 15px;
  font-weight: 600;
  transition: color 0.2s;
}
.modal-tab.is-active {
  color: #00C853;
  border-bottom-color: #00C853;
}
.modal-tab:hover:not(.is-active) { color: #fff; }

.modal-panel { display: none; }
.modal-panel.is-active { display: block; }

.modal-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 20px;
  color: #fff;
}

/* Notices */
.modal-notice {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}
.modal-notice--error {
  background: rgba(244, 67, 54, 0.12);
  border-left: 3px solid #f44336;
  color: #f44336;
}
.modal-notice--success {
  background: rgba(0, 200, 83, 0.12);
  border-left: 3px solid #00C853;
  color: #00C853;
}
[hidden].modal-notice { display: none; }

/* Footer link */
.modal-footer-link {
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: #aaa;
}
.link-btn {
  background: none;
  border: none;
  color: #00C853;
  cursor: pointer;
  text-decoration: underline;
  font-size: inherit;
  padding: 0;
}

/* Form helpers inside modal */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.btn--full { width: 100%; }

/* RTL support */
[dir="rtl"] .modal-box { text-align: right; }
[dir="rtl"] .modal-notice { border-left: none; border-right: 3px solid; }
[dir="rtl"] .modal-close { right: auto; left: 16px; }
