/* ==========================================================================
   Pet Grooming Lead-Capture Modal Popup Styles
   ========================================================================== */

/* Backdrop Overlay */
.lead-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  padding: 16px;
  box-sizing: border-box;
}

.lead-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Modal Card */
.lead-popup-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: #f4f7fb;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.2);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: inherit;
  box-sizing: border-box;
}

.lead-popup-overlay.active .lead-popup-card {
  transform: translateY(0) scale(1);
}

/* Close Button */
.lead-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.lead-popup-close:hover,
.lead-popup-close:focus {
  background: #ffffff;
  color: #0f172a;
  transform: scale(1.08);
  outline: none;
}

.lead-popup-close svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
}

/* Header Image Container */
.lead-popup-header-img {
  width: 100%;
  height: 190px;
  background-color: #e2e8f0;
  overflow: hidden;
  position: relative;
}

.lead-popup-header-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

/* Body Content */
.lead-popup-body {
  padding: 1.25rem 1.5rem 1.75rem 1.5rem;
}

/* Titles */
.lead-popup-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: #0f172a;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0 0 0.35rem 0;
  line-height: 1.2;
}

.lead-popup-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  color: #7c3aed; /* Violet / Purple from prompt & ref design */
  text-align: center;
  margin: 0 0 1.25rem 0;
}

/* Form Styling */
.lead-popup-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.lead-popup-field {
  position: relative;
  display: flex;
  flex-direction: column;
}

.lead-popup-input,
.lead-popup-select,
.lead-popup-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.925rem;
  font-family: inherit;
  color: #1e293b;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.lead-popup-textarea {
  resize: vertical;
  min-height: 60px;
}

.lead-popup-input::placeholder,
.lead-popup-textarea::placeholder {
  color: #94a3b8;
}

.lead-popup-select {
  padding-right: 2.25rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%20334155'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.1rem;
}

.lead-popup-input:focus,
.lead-popup-select:focus,
.lead-popup-textarea:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.lead-popup-field.has-error .lead-popup-input,
.lead-popup-field.has-error .lead-popup-select,
.lead-popup-field.has-error .lead-popup-textarea {
  border-color: #ef4444;
  background-color: #fef2f2;
}

.lead-popup-error {
  font-size: 0.775rem;
  color: #dc2626;
  font-weight: 600;
  margin-top: 0.25rem;
  padding-left: 0.25rem;
  display: none;
}

.lead-popup-field.has-error .lead-popup-error {
  display: block;
}

/* Submit Button */
.lead-popup-submit-btn {
  margin-top: 0.35rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: inherit;
  color: #1e1b4b;
  background: linear-gradient(135deg, #eab308 0%, #d97706 100%);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.lead-popup-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.45);
  filter: brightness(1.05);
}

.lead-popup-submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}

.lead-popup-submit-btn svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

/* Spinner during submit */
.lead-popup-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: popup-spin 0.6s linear infinite;
}

@keyframes popup-spin {
  to { transform: rotate(360deg); }
}

.lead-popup-submit-btn.loading .lead-popup-btn-text,
.lead-popup-submit-btn.loading svg {
  display: none;
}

.lead-popup-submit-btn.loading .lead-popup-spinner {
  display: inline-block;
}

/* Success View */
.lead-popup-success {
  display: none;
  text-align: center;
  padding: 1.5rem 0.5rem;
}

.lead-popup-success.active {
  display: block;
}

.lead-popup-success-icon {
  width: 64px;
  height: 64px;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
}

.lead-popup-success-icon svg {
  width: 36px;
  height: 36px;
  stroke-width: 3;
}

.lead-popup-success-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.lead-popup-success-msg {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.lead-popup-success-close {
  background: #7c3aed;
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lead-popup-success-close:hover {
  background: #6d28d9;
}

/* Dark theme overrides compatibility */
[data-theme="dark"] .lead-popup-card {
  background: #1e293b;
  color: #f8fafc;
}

[data-theme="dark"] .lead-popup-title {
  color: #f8fafc;
}

[data-theme="dark"] .lead-popup-subtitle {
  color: #a78bfa;
}

[data-theme="dark"] .lead-popup-input,
[data-theme="dark"] .lead-popup-select {
  background-color: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .lead-popup-close {
  background: rgba(15, 23, 42, 0.85);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.1);
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .lead-popup-card {
    max-width: 100%;
    border-radius: 16px;
  }
  
  .lead-popup-header-img {
    height: 160px;
  }

  .lead-popup-body {
    padding: 1rem 1.15rem 1.25rem 1.15rem;
  }

  .lead-popup-title {
    font-size: 1.2rem;
  }

  .lead-popup-subtitle {
    font-size: 0.875rem;
    margin-bottom: 1rem;
  }
}
