/* ==========================================================================
   CirclesCo Popups — Frontend Styles
   ========================================================================== */

/* ------------------------------------------------------------------
   Overlay
   ------------------------------------------------------------------ */
.ccp-popup {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ccp-popup.is-open {
  opacity: 1;
  visibility: visible;
}

/* ------------------------------------------------------------------
   Inner container
   ------------------------------------------------------------------ */
.ccp-popup__inner {
  position: relative;
  display: flex;
  max-width: 700px;
  width: 92%;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.ccp-popup.is-open .ccp-popup__inner {
  transform: scale(1);
  opacity: 1;
}

/* ------------------------------------------------------------------
   Image area
   ------------------------------------------------------------------ */
.ccp-popup__image {
  flex: 0 0 45%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100%;
  border-radius: 14px 0 0 14px;
}

/* ------------------------------------------------------------------
   Content area
   ------------------------------------------------------------------ */
.ccp-popup__content {
  flex: 0 0 55%;
  padding: 36px;
  box-sizing: border-box;
}

/* ------------------------------------------------------------------
   Layout variants
   ------------------------------------------------------------------ */
.ccp-layout-image-right .ccp-popup__inner {
  flex-direction: row-reverse;
}
.ccp-layout-image-right .ccp-popup__image {
  border-radius: 0 14px 14px 0;
}

.ccp-layout-image-top .ccp-popup__inner {
  flex-direction: column;
}
.ccp-layout-image-top .ccp-popup__image {
  flex: 0 0 200px;
  height: 200px;
  min-height: 200px;
  width: 100%;
  border-radius: 14px 14px 0 0;
}
.ccp-layout-image-top .ccp-popup__content {
  flex: 1 1 auto;
  width: 100%;
}

.ccp-layout-no-image .ccp-popup__content {
  flex: 1 1 auto;
  width: 100%;
}

.ccp-popup__title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px;
  line-height: 1.3;
  font-family: var(--ccp-font-title, inherit);
}

.ccp-popup__body {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin: 0 0 20px;
  font-family: var(--ccp-font-body, inherit);
}

.ccp-popup__form input[type="text"],
.ccp-popup__form input[type="email"],
.ccp-popup__form input[type="url"],
.ccp-popup__form select,
.ccp-popup__source,
.ccp-popup__submit {
  font-family: var(--ccp-font-input, inherit);
}

/* ------------------------------------------------------------------
   Form
   ------------------------------------------------------------------ */
.ccp-popup__form input[type="text"],
.ccp-popup__form input[type="email"],
.ccp-popup__form input[type="url"] {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 10px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s ease;
}

.ccp-popup__form input[type="text"]:focus,
.ccp-popup__form input[type="email"]:focus,
.ccp-popup__form input[type="url"]:focus {
  border-color: var(--ccp-btn-bg, #1264ff);
}

.ccp-popup__form select,
.ccp-popup__source {
  display: block;
  width: 100% !important;
  max-width: 100%;
  padding: 12px 36px 12px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  color: #333;
  background-color: #fff;
  margin-bottom: 10px;
  box-sizing: border-box;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239b9b97' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.2s ease;
}

.ccp-popup__form select:focus,
.ccp-popup__source:focus {
  border-color: var(--ccp-btn-bg, #1264ff);
}

.ccp-popup__submit {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  cursor: pointer;
  background: var(--ccp-btn-bg, #1264ff);
  transition: background 0.2s ease;
}

.ccp-popup__submit:hover {
  background: var(--ccp-btn-hover, #0d4fcc);
}

.ccp-popup__submit.is-success {
  background: #16a34a !important;
  cursor: default;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  animation: ccpBtnSuccess 0.35s ease;
}

.ccp-popup__submit.is-success svg {
  flex-shrink: 0;
  color: #fff;
}

@keyframes ccpBtnSuccess {
  0%   { transform: scale(0.96); }
  55%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.ccp-popup__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ------------------------------------------------------------------
   Close button
   ------------------------------------------------------------------ */
.ccp-popup__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease;
  z-index: 2;
}

.ccp-popup__close:hover {
  background: rgba(0, 0, 0, 0.18);
}

.ccp-popup__close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #333;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ------------------------------------------------------------------
   Message area
   ------------------------------------------------------------------ */
.ccp-popup__message {
  font-size: 13px;
  margin-top: 8px;
}

.ccp-popup__message.is-success {
  color: #1a8d1a;
}

.ccp-popup__message.is-error {
  color: #d32f2f;
}

/* ------------------------------------------------------------------
   Mobile (stack vertically)
   ------------------------------------------------------------------ */
@media (max-width: 600px) {
  .ccp-popup__inner {
    flex-direction: column;
    max-width: 95%;
  }

  .ccp-popup__image {
    flex: none;
    width: 100%;
    max-height: 200px;
    min-height: 160px;
    border-radius: 14px 14px 0 0;
  }

  .ccp-popup__content {
    flex: none;
    width: 100%;
    padding: 24px;
  }
}
