/* ============================================================
   Email Wheel Popup — Premium Casino Design
   Matches the blue radial sunburst + gold wheel aesthetic
   ============================================================ */

/* --- Overlay --- */
.ew-overlay {
  position: fixed;
  inset: 0;
  z-index: 999998;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.ew-overlay.ew-visible {
  opacity: 1;
  visibility: visible;
}

/* --- Modal Container --- */
.ew-modal {
  position: fixed;
  z-index: 999999;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 94vw;
  max-width: 920px;
  border-radius: 20px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.4s ease;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
.ew-modal.ew-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* --- Inner Background — blue radial sunburst --- */
.ew-inner {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 460px;
  background: linear-gradient(135deg, #1a3a8a 0%, #1e40af 30%, #2563eb 60%, #1e3a8a 100%);
}

/* Sunburst rays via pseudo-element */
.ew-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 60% 50%, rgba(30, 58, 138, 0) 40%, rgba(10, 25, 80, 0.5) 100%),
    repeating-conic-gradient(
      from 0deg at 60% 50%,
      rgba(255, 255, 255, 0.03) 0deg 5deg,
      transparent 5deg 10deg
    );
  pointer-events: none;
  z-index: 0;
}

/* --- Close Button --- */
.ew-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 20;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  padding: 0;
}
.ew-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

/* --- Left Content Panel --- */
.ew-content {
  position: relative;
  z-index: 5;
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px 36px 36px;
  max-width: 480px;
}

/* Badge */
.ew-badge {
  display: inline-block;
  align-self: flex-start;
  background: #f5c842;
  color: #1a3a8a;
  font-size: 15px;
  font-weight: 700;
  font-style: italic;
  padding: 7px 28px;
  border-radius: 50px;
  letter-spacing: 0.3px;
  margin-bottom: 18px;
  box-shadow: 0 3px 12px rgba(245, 200, 66, 0.35);
}

/* Headline */
.ew-headline {
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.5px;
  margin: 0 0 14px;
  text-transform: uppercase;
}

/* Subtext */
.ew-subtext {
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 24px;
}

/* --- Email Form --- */
.ew-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ew-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.ew-email-input {
  width: 100%;
  padding: 14px 50px 14px 18px;
  border: 2px solid transparent;
  border-radius: 50px;
  font-size: 14px;
  color: #333;
  background: #fff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ew-email-input::placeholder {
  color: #999;
}
.ew-email-input:focus {
  border-color: #f5c842;
  box-shadow: 0 0 0 3px rgba(245, 200, 66, 0.25);
}
.ew-email-input.ew-input-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.ew-input-icon {
  position: absolute;
  right: 16px;
  font-size: 22px;
  pointer-events: none;
  opacity: 0.5;
}

/* CTA Button */
.ew-cta {
  display: block;
  width: 100%;
  padding: 15px 24px;
  border: none;
  border-radius: 50px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #1a3a8a;
  background: linear-gradient(180deg, #f5d84e 0%, #e8b518 100%);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 4px 20px rgba(245, 200, 66, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-align: center;
}
.ew-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(245, 200, 66, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.ew-cta:active {
  transform: translateY(0);
}
.ew-cta:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Error Message */
.ew-error {
  color: #fca5a5;
  font-size: 13px;
  padding: 0 4px;
  min-height: 18px;
  margin-top: -4px;
}

/* Terms */
.ew-terms {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
}
.ew-terms input[type="checkbox"] {
  margin-top: 3px;
  accent-color: #f5c842;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
.ew-terms-text {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  line-height: 1.5;
}
.ew-terms-text a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ew-terms-text a:hover {
  color: #f5c842;
}

/* --- Right Panel (Wheel) --- */
.ew-wheel-panel {
  position: relative;
  z-index: 5;
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 30px 30px 0;
  min-height: 380px;
}

/* Canvas Container */
.ew-wheel-container {
  position: relative;
  width: 340px;
  height: 340px;
}

.ew-wheel-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  filter: drop-shadow(0 8px 30px rgba(0, 0, 0, 0.35));
}

/* Pointer / Arrow — top center pointing down */
.ew-pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 28px solid #f5c842;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
}

/* Center dot */
.ew-center-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: radial-gradient(circle, #4a0020 30%, #8b1a4a 100%);
  border: 3px solid #d4a830;
  border-radius: 50%;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* --- Result Screen (after spin) --- */
.ew-result {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 36px;
  position: relative;
  z-index: 5;
  width: 100%;
}
.ew-result.ew-active {
  display: flex;
}

.ew-result-headline {
  color: #f5c842;
  font-size: 36px;
  font-weight: 800;
  margin: 0 0 8px;
}

.ew-result-prize {
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
}

.ew-result-value {
  color: #f5c842;
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 28px;
  text-transform: uppercase;
}

.ew-result-cta {
  display: inline-block;
  padding: 16px 48px;
  border: none;
  border-radius: 50px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #1a3a8a;
  background: linear-gradient(180deg, #f5d84e 0%, #e8b518 100%);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 20px rgba(245, 200, 66, 0.4);
  text-decoration: none;
}
.ew-result-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(245, 200, 66, 0.55);
}

/* --- Step visibility --- */
.ew-step-form { display: flex; flex-direction: row; align-items: stretch; width: 100%; }
.ew-step-form.ew-hidden { display: none; }
.ew-result.ew-hidden { display: none; }

/* --- Animations --- */
@keyframes ew-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.ew-shake {
  animation: ew-shake 0.4s ease;
}

@keyframes ew-confetti-pop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.ew-confetti-pop {
  animation: ew-confetti-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
  .ew-modal {
    max-width: 100vw;
    width: 96vw;
    border-radius: 16px;
  }

  .ew-inner {
    flex-direction: column;
    min-height: auto;
  }

  .ew-step-form {
    flex-direction: column;
  }

  .ew-content {
    padding: 32px 24px 20px;
    max-width: 100%;
    order: 1;
  }

  .ew-headline {
    font-size: 22px;
  }

  .ew-subtext {
    font-size: 13px;
    margin-bottom: 16px;
  }

  .ew-wheel-panel {
    order: 0;
    padding: 24px 16px 0;
    min-height: auto;
    justify-content: center;
  }

  .ew-wheel-container {
    width: 200px;
    height: 200px;
  }

  .ew-pointer {
    top: -10px;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 22px solid #f5c842;
  }

  .ew-center-dot {
    width: 16px;
    height: 16px;
    border-width: 2px;
  }

  .ew-result {
    padding: 32px 24px;
  }

  .ew-result-headline {
    font-size: 28px;
  }
}
