/* ============================================================
   Kantor Exchange Request Modal
   ============================================================ */

/* ── Modal overlay (Fancybox handles the overlay,
      but we also support standalone open/close) ── */
.kef-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.55);
  padding: 16px;
}

.kef-modal.kef-open {
  display: flex !important;
}

/* Popup box */
.kef-modal .popup-box {
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px 28px;
  max-width: 480px;
  width: 100%;
  position: relative;
  box-shadow: 0 8px 48px rgba(0,0,0,.18);
  max-height: 90vh;
  overflow-y: auto;
}

.kef-modal h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1a2340;
  margin: 0 0 20px;
}

/* Close button */
.kef-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: #aab4c8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}

.kef-close:hover {
  color: #1a2340;
  background: #f4f7fb;
}

/* ── Summary block ── */
.kef-summary {
  background: #f4f7fb;
  border: 1px solid #e0e8f4;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.kef-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 14px;
}

.kef-summary__label {
  color: #8c9ab5;
  font-weight: 500;
}

.kef-summary__val {
  font-weight: 700;
  color: #1a2340;
}

/* ── Form fields ── */
.kef-field {
  margin-bottom: 16px;
}

.kef-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #3a4a6b;
  margin-bottom: 6px;
}

.kef-req {
  color: #ef4444;
  margin-left: 2px;
}

.kef-field input {
  width: 100%;
  border: 1.5px solid #e0e8f4;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 15px;
  color: #1a2340;
  background: #fafbfd;
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
  font-family: inherit;
}

.kef-field input:focus {
  border-color: #188de7;
  background: #fff;
}

.kef-field input.kef-invalid {
  border-color: #ef4444;
}

.kef-err {
  display: block;
  font-size: 12px;
  color: #ef4444;
  margin-top: 4px;
  min-height: 16px;
}

/* ── Footer ── */
.kef-footer {
  margin-top: 20px;
}

.kef-footer .kef-submit {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(90deg, #188de7 0%, #1265c0 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s, transform .12s;
  letter-spacing: .02em;
}

.kef-footer .kef-submit:hover {
  opacity: .9;
  transform: translateY(-1px);
}

.kef-footer .kef-submit:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.kef-consent {
  font-size: 11px;
  color: #b0bac9;
  margin: 10px 0 0;
  text-align: center;
  line-height: 1.5;
}

.kef-consent a {
  color: #188de7;
  text-decoration: underline;
}

/* ── Result/error message ── */
.kef-result {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
}

.kef-result.kef-result--error {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
}

/* ── Success state ── */
.kef-success {
  text-align: center;
  padding: 20px 0 10px;
}

.kef-success__icon {
  width: 56px;
  height: 56px;
  background: #22c55e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  margin: 0 auto 16px;
}

.kef-success h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1a2340;
  margin: 0 0 8px;
}

.kef-success p {
  color: #6b7a99;
  margin: 0 0 20px;
}

.kef-close-btn {
  background: #f4f7fb;
  border: 1.5px solid #e0e8f4;
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 600;
  color: #3a4a6b;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}

.kef-close-btn:hover {
  background: #e0e8f4;
}

/* Admin status badge */
.kef-status-new { color: #188de7; font-weight: 600; }
.kef-status-done { color: #22c55e; font-weight: 600; }

/* Spinner inside button */
.kef-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: kef-spin .7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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

@media (max-width: 520px) {
  .kef-modal .popup-box {
    padding: 28px 18px 20px;
  }
}
