/* ============================================
   Culinartica – Cancel Retention Flow
   RTL | Hebrew | Premium Design
   ============================================ */

:root {
  --clr-primary:   #E8392A;
  --clr-primary-h: #C92E1F;
  --clr-secondary: #FF6B52;
  --clr-dark:      #1A1A1A;
  --clr-text:      #2C2C2C;
  --clr-muted:     #6B6B6B;
  --clr-bg:        #FFFFFF;
  --clr-surface:   #FAF9F7;
  --clr-border:    #EDEBE7;
  --clr-success:   #2E7D32;
  --clr-radius:    14px;
  --clr-shadow:    0 24px 64px rgba(0,0,0,0.18), 0 8px 24px rgba(0,0,0,0.10);
  --clr-font:      'Assistant', 'Rubik', sans-serif;
  --clr-anim:      cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Overlay ── */
#clr-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999998;
  background: rgba(15, 10, 5, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 16px;
  direction: rtl;
}
#clr-overlay.clr-active {
  display: flex;
  animation: clrFadeIn 0.25s ease forwards;
}

@keyframes clrFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Modal Box ── */
.clr-modal {
  background: var(--clr-bg);
  border-radius: var(--clr-radius);
  box-shadow: var(--clr-shadow);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: clrSlideUp 0.35s var(--clr-anim) forwards;
  direction: rtl;
  text-align: right;
  font-family: var(--clr-font);
}

@keyframes clrSlideUp {
  from { transform: translateY(30px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ── Modal Header ── */
.clr-modal-header {
  background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-secondary) 100%);
  padding: 28px 28px 24px;
  border-radius: var(--clr-radius) var(--clr-radius) 0 0;
  position: relative;
  overflow: hidden;
}
.clr-modal-header::before {
  content: '';
  position: absolute;
  top: -30px; left: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.clr-modal-header::after {
  content: '';
  position: absolute;
  bottom: -20px; right: 20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.clr-modal-emoji {
  font-size: 36px;
  margin-bottom: 10px;
  display: block;
  position: relative;
  z-index: 1;
}

.clr-modal-header h2 {
  color: #fff;
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.3px;
  position: relative;
  z-index: 1;
}

.clr-modal-header p {
  color: rgba(255,255,255,0.85);
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

/* ── Close Button ── */
.clr-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  transition: background 0.2s;
  z-index: 10;
}
.clr-close:hover { background: rgba(255,255,255,0.35); }

/* ── Modal Body ── */
.clr-modal-body {
  padding: 24px 28px 28px;
}

/* ── Step visibility ── */
.clr-step { display: none; }
.clr-step.clr-visible { display: block; }

/* ── Reason Options ── */
.clr-reasons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.clr-reason-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--clr-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  background: var(--clr-surface);
}
.clr-reason-option:hover {
  border-color: var(--clr-primary);
  background: #FFF5F4;
}
.clr-reason-option.selected {
  border-color: var(--clr-primary);
  background: #FFF0EE;
}

.clr-reason-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border: 2px solid #CCC;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.18s;
  position: relative;
}
.clr-reason-option input[type="radio"]::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 10px; height: 10px;
  background: var(--clr-primary);
  border-radius: 50%;
  transition: transform 0.18s var(--clr-anim);
}
.clr-reason-option input[type="radio"]:checked {
  border-color: var(--clr-primary);
}
.clr-reason-option input[type="radio"]:checked::after {
  transform: translate(-50%, -50%) scale(1);
}

.clr-reason-option .clr-reason-emoji {
  font-size: 20px;
}
.clr-reason-option .clr-reason-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--clr-text);
}

/* ── Offer Cards ── */
.clr-offer-card {
  display: none;
}
.clr-offer-card.clr-visible {
  display: block;
  animation: clrFadeIn 0.25s ease;
}

.clr-offer-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--clr-dark);
  margin: 0 0 6px;
}
.clr-offer-desc {
  font-size: 14px;
  color: var(--clr-muted);
  margin: 0 0 20px;
  line-height: 1.6;
}

.clr-offer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

/* ── Buttons ── */
.clr-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 10px;
  font-family: var(--clr-font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s ease;
  letter-spacing: -0.2px;
}
.clr-btn:focus { outline: 3px solid var(--clr-secondary); outline-offset: 2px; }

.clr-btn-primary {
  background: linear-gradient(135deg, var(--clr-primary) 0%, var(--clr-secondary) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(232, 57, 42, 0.35);
}
.clr-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232, 57, 42, 0.45);
}

.clr-btn-secondary {
  background: var(--clr-surface);
  color: var(--clr-text);
  border: 2px solid var(--clr-border);
}
.clr-btn-secondary:hover {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
  background: #FFF5F4;
}

.clr-btn-ghost {
  background: transparent;
  color: var(--clr-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.clr-btn-ghost:hover { color: var(--clr-primary); }

/* Next button (Step 1) */
.clr-btn-next {
  margin-top: 4px;
}

/* ── Divider ── */
.clr-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  color: var(--clr-muted);
  font-size: 12px;
}
.clr-divider::before,
.clr-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--clr-border);
}

/* ── Cancel final ── */
.clr-final-cancel {
  margin-top: 16px;
  text-align: center;
}

/* ── Trust badge ── */
.clr-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--clr-muted);
}
.clr-trust svg {
  color: var(--clr-primary);
  flex-shrink: 0;
}

/* ── Back button ── */
.clr-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--clr-muted);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--clr-font);
  margin-bottom: 18px;
  padding: 0;
  transition: color 0.15s;
}
.clr-back:hover { color: var(--clr-primary); }

/* ── Progress dots ── */
.clr-progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 16px 0 4px;
}
.clr-progress-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--clr-border);
  transition: all 0.25s ease;
}
.clr-progress-dot.active {
  background: var(--clr-primary);
  width: 20px;
  border-radius: 3px;
}

/* ── Scrollbar ── */
.clr-modal::-webkit-scrollbar { width: 4px; }
.clr-modal::-webkit-scrollbar-track { background: transparent; }
.clr-modal::-webkit-scrollbar-thumb { background: var(--clr-border); border-radius: 2px; }

/* ── Mobile ── */
@media (max-width: 540px) {
  .clr-modal-header { padding: 22px 20px 18px; }
  .clr-modal-body   { padding: 18px 20px 22px; }
  .clr-modal-header h2 { font-size: 19px; }
  .clr-reason-option { padding: 12px 14px; }
}
.clr-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  min-width: 260px;
  max-width: 90vw;
  padding: 14px 18px;
  border-radius: 12px;
  color: #fff;
  font-family: var(--clr-font);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
  z-index: 1000001;
  opacity: 0;
  transition: all 0.28s ease;
}

.clr-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.clr-toast-success {
  background: linear-gradient(135deg, #2e7d32 0%, #43a047 100%);
}

.clr-toast-error {
  background: linear-gradient(135deg, #c62828 0%, #e53935 100%);
}

a.clr-btn-primary,
a.clr-btn-primary:visited,
a.clr-btn-primary:hover,
a.clr-btn-primary:focus {
  color: #fff !important;
}

a.clr-btn-secondary,
a.clr-btn-secondary:visited,
a.clr-btn-secondary:hover,
a.clr-btn-secondary:focus {
  color: var(--clr-text) !important;
}