.cp-overlay {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  background: rgba(12, 16, 34, .6);
  backdrop-filter: blur(6px);
  animation: fadeIn .3s ease both;
}
.cp-overlay[hidden] { display: none; }
.cp-overlay.leaving { animation: fadeIn .25s ease reverse forwards; }
.cp-card {
  width: min(460px, 100%);
  background: var(--surface);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .6);
  animation: popIn .55s var(--ease-spring) both;
}
.cp-hero {
  position: relative;
  padding: 30px 28px 26px;
  text-align: center;
  color: #fff;
  background: var(--gradient-primary);
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  overflow: hidden;
}
.cp-hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  top: -110px;
  right: -60px;
}
.cp-hero-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  animation: float 4s ease-in-out infinite;
}
.cp-hero h4 { color: #fff; font-size: 21px; margin: 0 0 6px; }
.cp-hero p { margin: 0; color: rgba(255, 255, 255, .85); font-size: 13.5px; }
.cp-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  transition: background .2s;
}
.cp-close:hover { background: rgba(255, 255, 255, .3); }
.cp-overlay.mandatory .cp-close { display: none; }

.cp-body { padding: 24px 28px 26px; }
.cp-notice {
  display: none;
  gap: 10px;
  padding: 11px 13px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--warning-50);
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 12.5px;
}
.cp-overlay.mandatory .cp-notice { display: flex; }
.cp-password .form-control { padding-right: 44px; }
.cp-eye {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.cp-eye:hover { background: var(--primary-50); color: var(--primary); }
.cp-match {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  font-size: 18px;
  transition: transform .3s var(--ease-spring);
}
.cp-match.show { transform: translateY(-50%) scale(1); }

.cp-strength { display: flex; align-items: center; gap: 12px; margin: 10px 0 12px; }
.cp-strength-bars { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.cp-strength-bars span { height: 6px; border-radius: 6px; background: var(--secondary-50); transition: background .35s var(--ease), transform .35s var(--ease); }
.cp-strength-label { font-size: 12px; font-weight: 600; color: var(--muted); min-width: 92px; text-align: right; transition: color .3s; }
.cp-strength[data-level="1"] .cp-strength-bars span:nth-child(-n+1) { background: var(--danger); }
.cp-strength[data-level="2"] .cp-strength-bars span:nth-child(-n+2) { background: var(--warning); }
.cp-strength[data-level="3"] .cp-strength-bars span:nth-child(-n+3) { background: var(--info); }
.cp-strength[data-level="4"] .cp-strength-bars span { background: var(--success); }
.cp-strength[data-level="1"] .cp-strength-label { color: var(--danger); }
.cp-strength[data-level="2"] .cp-strength-label { color: #b45309; }
.cp-strength[data-level="3"] .cp-strength-label { color: var(--info); }
.cp-strength[data-level="4"] .cp-strength-label { color: #059669; }

.cp-rules {
  list-style: none;
  padding: 12px 14px;
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.cp-rules li { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; transition: color .25s; }
.cp-rules li i { transition: transform .35s var(--ease-spring), color .25s; }
.cp-rules li.ok { color: #059669; }
.cp-rules li.ok i { color: var(--success); transform: scale(1.2); }

.cp-error {
  display: none;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: var(--danger-50);
  color: #b91c1c;
  font-size: 13px;
  font-weight: 500;
  animation: fadeDown .3s var(--ease);
}
.cp-error.show { display: flex; }
.cp-actions { display: flex; gap: 10px; }
.cp-actions .btn { flex: 1; height: 44px; }

@media (max-width: 480px) {
  .cp-rules { grid-template-columns: 1fr; }
  .cp-body { padding: 20px; }
}
