/* Popup wrapper */
.cpc-popup__wrap {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.cpc-popup__wrap.active {
  display: flex;
}

/* Backdrop */
.cpc-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

/* Popup content */
.cpc-popup {
  position: relative;
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 448px;
  width: 100%;
  overflow: hidden;
  animation: slideIn 0.2s ease-out;
}

/* Icon Header */
.cpc-popup__icon-header {
  display: flex;
  justify-content: center;
  padding-top: 32px;
  padding-bottom: 16px;
}

.cpc-popup__icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0, 115, 191, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cpc-popup__icon-phone {
  width: 32px;
  height: 32px;
  color: #0073BF;
}

/* Content */
.cpc-popup__content {
  padding: 0 32px 32px;
  text-align: center;
}

/* Popup title */
.cpc-popup__title {
  font-size: 24px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 12px;
}

/* Phone Number Box */
.cpc-popup__phone-number-box {
  margin-bottom: 16px;
  padding: 16px 24px;
  background: #f9fafb;
  border-radius: 12px;
}

.cpc-popup__phone-number {
  font-size: 28px;
  font-weight: 700;
  color: #0073BF;
  letter-spacing: 0.05em;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Warning Box */
.cpc-popup__warning-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  background: #fef2f2;
  border-radius: 12px;
  text-align: left;
}

.cpc-popup__icon-alert {
  width: 20px;
  height: 20px;
  color: #ef4444;
  flex-shrink: 0;
  margin-top: 2px;
}

.cpc-popup__warning-text {
  font-size: 14px;
  color: #991b1b;
  line-height: 1.5;
  margin: 0;
}

/* Popup buttons wrapper */
.cpc-popup__buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Popup button styles */
.cpc-popup__button {
  width: 100%;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-align: center;
}

/* Button "Номер верный" */
.cpc-popup__button--confirm {
  background: #0073BF;
  color: white;
}

.cpc-popup__button--confirm:hover {
  background: #005a99;
}

/* Button "Изменить номер" */
.cpc-popup__button--change {
  background: white;
  color: #374151;
  border: 2px solid #e5e7eb;
}

.cpc-popup__button--change:hover {
  background: #f9fafb;
  color: #374151;
  border-color: #d1d5db;
}

/* SVG Icons */
.cpc-popup svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Edit phone input */
.cpc-popup__edit-phone {
  display: none;
  width: 100%;
  padding: 16px 24px;
  border: 2px solid #e5e7eb;
  font-size: 18px;
  background-color: #FFFFFF;
  border-radius: 12px;
  box-sizing: border-box;
  margin: 0 auto 16px auto;
  text-align: center;
  transition: all 0.3s;
}

.cpc-popup__edit-phone:focus {
  border-color: #61bdf7 !important;
  box-shadow: 0 0 0 1px #61bdf7 !important;
}

.cpc-popup__edit-phone.active {
  display: block;
}

.cpc-popup__edit-phone:focus {
  outline: none;
  border-color: #0073BF;
}

/* Error message */
.cpc-popup__error {
  display: none;
  color: #ef4444;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  margin: -8px auto 16px auto;
  padding: 0;
  min-height: 20px;
}

.cpc-popup__error.active {
  display: block;
}

.cpc-popup__edit-phone.active + .cpc-popup__error {
  margin-top: 0;
  margin-bottom: 16px;
}

/* Mobile styles */
@media (max-width: 768px) {
  .cpc-popup {
    max-width: 95%;
  }

  .cpc-popup__icon-header {
    padding-top: 24px;
    padding-bottom: 12px;
  }

  .cpc-popup__icon-circle {
    width: 56px;
    height: 56px;
  }

  .cpc-popup__icon-phone {
    width: 28px;
    height: 28px;
  }

  .cpc-popup__content {
    padding: 0 24px 24px;
  }

  .cpc-popup__title {
    font-size: 20px;
  }

  .cpc-popup__phone-number {
    font-size: 24px;
  }

  .cpc-popup__warning-text {
    font-size: 13px;
  }

  .cpc-popup__button {
    padding: 14px 20px;
    font-size: 15px;
  }
}

