/* ============================================================
   PECivilClick — Conversion Optimization Tools
   Styles for: Cookie Consent Banner, FOMO Social Proof Toasts,
               Countdown Timer
   ============================================================ */

/* ----------------------------------------------------------
   0. SHARED / RESET
   ---------------------------------------------------------- */
.pecivil-cookie-banner,
.pecivil-fomo-toast,
.pecivil-countdown-timer {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
  line-height: 1.5;
}

.pecivil-cookie-banner *,
.pecivil-fomo-toast *,
.pecivil-countdown-timer * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ----------------------------------------------------------
   1. COOKIE CONSENT BANNER
   ---------------------------------------------------------- */
.pecivil-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background: var(--bg-white, #FFFFFF);
  border-top: 1px solid var(--border, #E2E8F0);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.pecivil-cookie-banner.pecivil-visible {
  transform: translateY(0);
}

.pecivil-cookie-text {
  font-size: 14px;
  color: var(--text-medium, #475569);
  flex: 1 1 300px;
  text-align: center;
}

.pecivil-cookie-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.pecivil-cookie-accept {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #FFFFFF;
  background: var(--gradient-primary, linear-gradient(135deg, #0072A7 0%, #00A0E4 100%));
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.pecivil-cookie-accept:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 114, 167, 0.3);
}

.pecivil-cookie-accept:active {
  transform: translateY(0);
}

.pecivil-cookie-learn {
  font-size: 14px;
  font-family: inherit;
  color: var(--primary, #0072A7);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.pecivil-cookie-learn:hover {
  color: var(--primary-dark, #005580);
}


/* ----------------------------------------------------------
   3. FOMO SOCIAL PROOF TOAST
   ---------------------------------------------------------- */
.pecivil-fomo-toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9997;
  background: var(--bg-white, #FFFFFF);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 14px 42px 14px 16px;
  max-width: 360px;
  min-width: 280px;
  transform: translateX(calc(-100% - 40px));
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.4s ease;
  pointer-events: none;
}

.pecivil-fomo-toast.pecivil-visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.pecivil-fomo-toast-message {
  font-size: 14px;
  color: var(--text-dark, #0F172A);
  font-weight: 500;
  line-height: 1.45;
}

.pecivil-fomo-toast-time {
  font-size: 12px;
  color: var(--text-light, #64748B);
  margin-top: 4px;
}

.pecivil-fomo-toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  border-radius: 50%;
  font-size: 14px;
  color: var(--text-light, #64748B);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
  line-height: 1;
}

.pecivil-fomo-toast-close:hover {
  background: var(--bg-light, #F8FAFC);
  color: var(--text-dark, #0F172A);
}

/* Left accent stripe */
.pecivil-fomo-toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--gradient-primary, linear-gradient(135deg, #0072A7 0%, #00A0E4 100%));
}


/* ----------------------------------------------------------
   4. COUNTDOWN TIMER
   ---------------------------------------------------------- */
.pecivil-countdown-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--bg-blue-soft, #E0F2FE);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-dark, #005580);
  border: 1px solid rgba(0, 114, 167, 0.15);
}

.pecivil-countdown-timer-label {
  white-space: nowrap;
}

.pecivil-countdown-timer-digits {
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary, #0072A7);
}

/* Urgent state (< 1 hour) */
.pecivil-countdown-timer.pecivil-countdown-urgent {
  background: #FEF2F2;
  border-color: rgba(231, 76, 60, 0.2);
}

.pecivil-countdown-timer.pecivil-countdown-urgent .pecivil-countdown-timer-label {
  color: #B91C1C;
}

.pecivil-countdown-timer.pecivil-countdown-urgent .pecivil-countdown-timer-digits {
  color: #DC2626;
  animation: pecivil-pulse-urgent 1s ease-in-out infinite;
}

@keyframes pecivil-pulse-urgent {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}


/* ----------------------------------------------------------
   5. NEWSLETTER SUCCESS INLINE MESSAGE
   ---------------------------------------------------------- */
.pecivil-newsletter-success {
  display: inline-block;
  padding: 12px 20px;
  background: #ECFDF5;
  border: 1px solid rgba(0, 184, 148, 0.25);
  border-radius: 10px;
  color: #065F46;
  font-size: 15px;
  font-weight: 500;
  animation: pecivil-fade-in 0.35s ease;
}


/* ----------------------------------------------------------
   6. ANIMATIONS (shared keyframes)
   ---------------------------------------------------------- */
@keyframes pecivil-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ----------------------------------------------------------
   7. RESPONSIVE ADJUSTMENTS
   ---------------------------------------------------------- */
@media (max-width: 640px) {

  /* Cookie banner — stack vertically */
  .pecivil-cookie-banner {
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px;
  }

  .pecivil-cookie-text {
    font-size: 13px;
    text-align: center;
    flex-basis: auto;
  }

  .pecivil-cookie-actions {
    width: 100%;
    justify-content: center;
  }

  /* FOMO toast — full width on very small screens */
  .pecivil-fomo-toast {
    left: 12px;
    right: 12px;
    bottom: 16px;
    max-width: none;
    min-width: 0;
  }

  /* Countdown timer */
  .pecivil-countdown-timer {
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    padding: 12px 16px;
  }

  .pecivil-countdown-timer-digits {
    font-size: 20px;
  }
}


/* ----------------------------------------------------------
   8. REDUCED MOTION
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .pecivil-cookie-banner,
  .pecivil-fomo-toast,
  .pecivil-countdown-timer-digits {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
