/* =============================================
 * Callback Request Modal
 *
 * Reuses: .btn, .input, .form__group, .error
 * from comps.css. Spinner from calc.css.
 * ============================================= */

/* ===================== */
/* // MODAL SHELL
/* ===================== */

.cb-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
}

.cb-modal.open {
  display: block;
}

/* ===================== */
/* // OVERLAY
/* ===================== */

.cb-modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: cb-fadeIn 0.2s ease-out;
}

/* ===================== */
/* // CONTAINER (centering)
/* ===================== */

.cb-modal__container {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
}

/* ===================== */
/* // DIALOG
/* ===================== */

.cb-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
  animation: cb-slideUp 0.25s ease-out;
}

@media (max-width: 575px) {
  .cb-modal__dialog {
    padding: 1.5rem;
    border-radius: 16px;
  }
}

/* ===================== */
/* // HEADER
/* ===================== */

.cb-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.cb-modal__title {
  font-family: var(--font-heading);
  font-size: var(--fs-4);
  font-weight: 700;
  color: #202426;
  margin: 0;
}

.cb-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: none;
  color: #adb6bd;
  cursor: pointer;
  transition: 0.2s;
  flex-shrink: 0;
}

.cb-modal__close:hover {
  background: #f5f7f8;
  color: #202426;
}

/* ===================== */
/* // FORM
/* ===================== */

.cb-modal__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cb-modal__form.hidden {
  display: none;
}

.cb-modal__label {
  color: #6c767d;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.6px;
}

/* Reuse hero/cta form input styles for visual consistency */
.cb-modal__form .input input {
  background: #f9f9fa;
  border: 1px solid #dee3e6;
  border-radius: 10px;
  color: #000;
  padding: 12px 15px;
  font-size: var(--fs-6);
  font-weight: 400;
  transition: 0.3s;
  min-height: 48px;
}

.cb-modal__form .input input:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-20);
}

.cb-modal__form .input input::placeholder {
  color: #adb6bd;
}

/* Error border reuse from calc.css */
.cb-modal__form .form__group.has-error .input input {
  border-color: #ef4444;
}

.cb-modal__form .form__group.has-error .input input:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Error text — reuses .error from comps.css */
.cb-modal__form .form__group > .error {
  min-height: 0;
}

.cb-modal__form .form__group > .error:empty {
  display: none;
}

/* ===================== */
/* // CHECKBOX
/* ===================== */

.cb-modal__checkbox-row {
  display: flex;
  align-items: center;
}

.cb-modal__checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #6c767d;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.cb-modal__checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ===================== */
/* // SUBMIT BUTTON STATES
/* ===================== */

.cb-modal__submit-text {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cb-modal__submit-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cb-modal__submit-loading .calc__spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}

/* ===================== */
/* // GENERAL ERROR
/* ===================== */

.cb-modal__error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #fef2f2;
  border-radius: 10px;
  color: #ef4444;
  font-size: 13px;
  text-align: center;
}

.cb-modal__error.hidden {
  display: none;
}

/* ===================== */
/* // SUCCESS STATE
/* ===================== */

.cb-modal__success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 0 1rem;
}

.cb-modal__success.hidden {
  display: none;
}

.cb-modal__success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #0dde34;
  color: #fff;
  margin-bottom: 1rem;
}

.cb-modal__success-icon iconify-icon {
  font-size: 28px;
}

.cb-modal__success h4 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: #202426;
  margin: 0 0 0.5rem;
}

.cb-modal__success p {
  font-size: 14px;
  color: #6c767d;
  line-height: 1.5;
  max-width: 300px;
  margin: 0;
}

/* ===================== */
/* // ANIMATIONS
/* ===================== */

@keyframes cb-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cb-slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================== */
/* // HIDDEN UTILITY (scoped)
/* ===================== */

.cb-modal .hidden {
  display: none !important;
}
