/* ============================================
   Calma Popups
   ============================================ */

.calma-popup {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
}

.calma-popup.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.calma-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(40, 25, 15, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}

.calma-popup__dialog {
  position: relative;
  background: #FFFFFF;
  border-radius: 24px;
  max-width: 1080px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 56px 64px 48px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  transform: scale(0.96) translateY(8px);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-sizing: border-box;
}

.calma-popup.is-open .calma-popup__dialog {
  transform: scale(1) translateY(0);
}

.calma-popup__close {
  position: absolute;
  top: 28px;
  right: 28px;
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #1A1A1A;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  transition: background 0.2s ease, color 0.2s ease;
  z-index: 2;
}

.calma-popup__close:hover {
  background: #F3F3F3;
  color: #F06A1A;
}

.calma-popup__title {
  color: #F06A1A;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: clamp(28px, 4.2vw, 52px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 28px;
  padding-right: 48px;
}

.calma-popup__subtitle {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #1A1A1A;
  margin: 0 0 12px;
  line-height: 1.4;
}

.calma-popup__text {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: #2A2A2A;
  margin: 0 0 28px;
}

/* ============================================
   Fluent Forms overrides — pill inputs + orange button
   ============================================ */
.calma-popup__form .fluentform .ff-el-group,
.calma-popup__form .fluentform .ff-el-form-control-wrap {
  margin-bottom: 0;
}

.calma-popup__form .fluentform .ff-t-container {
  gap: 16px;
}

.calma-popup__form input[type="text"],
.calma-popup__form input[type="tel"],
.calma-popup__form input[type="email"],
.calma-popup__form input[type="number"],
.calma-popup__form .ff-el-form-control {
  border: 1.5px solid #D0D0D0 !important;
  border-radius: 999px !important;
  padding: 14px 24px !important;
  height: auto !important;
  font-size: 16px !important;
  width: 100% !important;
  font-family: "DM Sans", sans-serif !important;
  background: #FFFFFF !important;
  color: #2A2A2A !important;
  box-shadow: none !important;
  outline: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
  box-sizing: border-box !important;
}

.calma-popup__form input[type="text"]:focus,
.calma-popup__form input[type="tel"]:focus,
.calma-popup__form input[type="email"]:focus,
.calma-popup__form input[type="number"]:focus,
.calma-popup__form .ff-el-form-control:focus {
  border-color: #F06A1A !important;
  box-shadow: 0 0 0 4px rgba(240, 106, 26, 0.15) !important;
}

.calma-popup__form input::placeholder,
.calma-popup__form .ff-el-form-control::placeholder {
  color: #888 !important;
  opacity: 1 !important;
}

.calma-popup__form .ff-btn,
.calma-popup__form .ff-btn-submit,
.calma-popup__form button[type="submit"] {
  background: #F06A1A !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 999px !important;
  padding: 14px 32px !important;
  height: auto !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  font-family: "DM Sans", sans-serif !important;
  cursor: pointer !important;
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease !important;
  white-space: nowrap !important;
  box-shadow: 0 4px 14px rgba(240, 106, 26, 0.25) !important;
}

.calma-popup__form .ff-btn:hover,
.calma-popup__form .ff-btn-submit:hover,
.calma-popup__form button[type="submit"]:hover {
  background: #D85A12 !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(240, 106, 26, 0.40) !important;
}

/* Hide labels (zostają tylko placeholdery) */
.calma-popup__form .fluentform .ff-el-input--label {
  display: none !important;
}

/* Layout poprawki dla Fluent Forms rows */
.calma-popup__form .fluentform .ff-t-container > .ff-t-cell {
  padding: 0 !important;
}

/* Komunikat sukcesu */
.calma-popup__form .ff-message-success {
  background: rgba(240, 106, 26, 0.08) !important;
  border: 1px solid rgba(240, 106, 26, 0.3) !important;
  color: #1A1A1A !important;
  border-radius: 16px !important;
  padding: 20px !important;
  font-family: "DM Sans", sans-serif !important;
}

/* ============================================
   Body scroll lock
   ============================================ */
body.calma-popup-open {
  overflow: hidden;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 720px) {
  .calma-popup {
    padding: 16px;
  }
  .calma-popup__dialog {
    padding: 56px 24px 32px;
    border-radius: 20px;
  }
  .calma-popup__close {
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
  }
  .calma-popup__title {
    padding-right: 28px;
    margin-bottom: 20px;
    font-size: clamp(24px, 7vw, 32px);
  }
  .calma-popup__form .ff-btn,
  .calma-popup__form .ff-btn-submit,
  .calma-popup__form button[type="submit"] {
    width: 100% !important;
  }
}

/* Accessibility — uszanuj reduced motion */
@media (prefers-reduced-motion: reduce) {
  .calma-popup,
  .calma-popup__dialog,
  .calma-popup__form .ff-btn:hover {
    transition: none !important;
    transform: none !important;
  }
}
