/* ==========================================================================
   Create – Signup Discount Popup
   ========================================================================== */

/* Overlay */
.csd-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.55);
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.csd-overlay.csd-overlay--visible {
  opacity: 1;
}

/* Modal */
.csd-modal {
  position: relative;
  background: #fff;
  border-radius: 4px;
  width: 100%;
  max-width: 460px;
  padding: 2.5rem 2rem 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  transform: translateY(24px);
  transition: transform 0.35s ease;
  text-align: center;
  overflow: hidden;
}

/* Two-column layout when image is present */
.csd-modal--has-image {
  max-width: 820px;
  padding: 0;
  display: flex;
  align-items: stretch;
}

.csd-modal--has-image .csd-close {
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
}

.csd-image {
  flex: 0 0 42%;
  min-height: 320px;
  overflow: hidden;
}

.csd-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.csd-content {
  flex: 1;
  padding: 2.5rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* When no image, .csd-content is just a transparent wrapper */
.csd-modal:not(.csd-modal--has-image) .csd-content {
  padding: 0;
}

.csd-overlay.csd-overlay--visible .csd-modal {
  transform: translateY(0);
}

/* Close button */
.csd-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  color: #888;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s;
}

.csd-close:hover {
  color: #111;
}

/* Badge */
.csd-badge {
  display: inline-block;
  background: #5b7fe7;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 2px;
  margin-bottom: 1rem;
}

/* Title */
.csd-title {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  color: #1a1a1a;
  margin: 0 0 0.75rem;
}

/* Body text */
.csd-body {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
  margin: 0 0 1.25rem;
}

/* Form */
.csd-field {
  margin-bottom: 0.75rem;
}

.csd-field input[type="email"] {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-bottom: 1px solid #ccc;
  border-radius: 0;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.csd-field input[type="email"]:focus {
  border-color: #1a1a1a;
}

.csd-error {
  color: #c0392b;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  text-align: left;
}

/* Submit button */
.csd-submit {
  display: block;
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid #1a1a1a;
  border-radius: 20px;
 
  color: black;
  cursor: pointer;
 transition: all 0.3s ease-out 0s;
}

.csd-submit:hover:not(:disabled) {
  background: black;
  color: white;
  transition: all 0.3s ease-out 0s;
}

.csd-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.csd-submit--outline {
  background: transparent;
  color: #1a1a1a;
  margin-top: 1rem;
}

.csd-submit--outline:hover {
  background: #1a1a1a;
  color: #fff;
}

/* Legal */
.csd-legal {
  font-size: 0.72rem;
  color: #aaa;
  margin-top: 0.75rem;
  line-height: 1.5;
}

/* Panels */
.csd-panel {
  transition: opacity 0.2s;
}

/* Success panel */
.csd-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  background: #1a1a1a;
  color: #fff;
  border-radius: 50%;
  font-size: 1.4rem;
  margin: 0 auto 1.25rem;
}

.csd-coupon-display {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  background: #f5f5f5;
  border: 2px dashed #ccc;
  padding: 0.6rem 1.5rem;
  border-radius: 4px;
  color: #1a1a1a;
  margin: 0 0 0.5rem;
  word-break: break-all;
}

/* Screen reader only */
.csd-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive */
@media (max-width: 640px) {
  .csd-modal--has-image {
    flex-direction: column;
    max-width: 460px;
  }

  .csd-image {
    flex: none;
    min-height: 180px;
    width: 100%;
  }

  .csd-modal--has-image .csd-content {
    padding: 2rem 1.25rem 1.5rem;
  }
}

@media (max-width: 500px) {
  .csd-modal {
    padding: 2rem 1.25rem 1.5rem;
  }

  .csd-title {
    font-size: 1.3rem;
  }
}
