/* Modern Modal Styles */
.download-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.33, 1, 0.68, 1);
  z-index: 9999;
}

.download-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.download-modal-content {
  background: white;
  border-radius: 24px;
  padding: 0;
  max-width: 480px;
  width: 90%;
  position: relative;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.33, 1, 0.68, 1);
  overflow: hidden;
}

.download-modal-overlay.active .download-modal-content {
  transform: translateY(0);
}

.download-modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.download-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.download-modal-header {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  padding: 3rem 2rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.download-modal-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.15;
}

.download-modal-logo-container {
  width: 100px;
  height: 100px;
  background: white;
  border-radius: 23px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow:
    0 6px 12px rgba(0, 0, 0, 0.1),
    inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  padding: 4px; /* ↓ Reduced from 12px to let the icon fill more space */
}

.download-modal-app-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* perfect vertical + horizontal centering */
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 14px;
}

/* Optional: Add subtle reflection effect */
.download-modal-logo-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  border-radius: 23px 23px 0 0;
  pointer-events: none;
}

.download-modal-logo {
  width: 50px;
  height: auto;
  filter: brightness(0) invert(1);
}

.download-modal-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
  margin: 0 0 0.5rem;
  position: relative;
}

.download-modal-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  font-weight: 400;
  position: relative;
}

.download-modal-body {
  padding: 2rem;
}

.download-modal-message {
  margin-bottom: 2rem;
  line-height: 1.6;
  color: #475569;
  font-size: 1.05rem;
  text-align: center;
}

.download-modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.download-form-group {
  position: relative;
}

.download-form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #334155;
  font-size: 0.9rem;
}

.download-form-group input {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f8fafc;
  color: #1e293b;
}

.download-form-group input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background: white;
}

.download-modal-submit {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.download-modal-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.download-modal-submit:active {
  transform: translateY(0);
}

.download-app-badges {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.download-app-badge {
  height: 50px;
  width: auto;
  transition: all 0.3s ease;
}

.download-app-badge:hover {
  transform: scale(1.05);
}

.honeypot {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .download-modal-header {
    padding: 2rem 1.5rem 1.5rem;
  }

  .download-modal-body {
    padding: 1.5rem;
  }

  .download-modal-title {
    font-size: 1.5rem;
  }

  .download-modal-logo-container {
    width: 70px;
    height: 70px;
    padding: 3px; /* Scales proportionally on small screens */
  }

  .download-modal-app-icon {
    max-width: 60px; /* Ensure it can't overflow the smaller container */
  }
}

/* Subscription modal (scoped to avoid touching other modals) */
#subscriptionModal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.45);
  z-index: 10000;
}
#subscriptionModal[hidden] { display: none; }

#subscriptionModal .submodal-card {
  position: relative;
  width: min(520px, 92vw);
  background: #fff;
  border-radius: 16px;
  padding: 24px 24px 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,.15);
}

#subscriptionModal h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a202c; /* text-primary */
}
#subscriptionModal p { margin: 0 0 12px; color: #4a5568; } /* text-secondary */

#subscriptionModal .submodal-button {
  background: var(--wellsaid-blue, #4F7CFF); /* fallback if variable missing */
  color: #fff;
  display: inline-block;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(79,124,255,.25);
}
#subscriptionModal .submodal-button:hover { filter: brightness(.95); }

#subscriptionModal .submodal-note {
  margin-top: 16px;
  font-size: .95rem;
  color: #718096; /* muted */
}

#subscriptionModal .submodal-close {
  position: absolute;
  top: 10px; right: 12px;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #a0aec0;
}
#subscriptionModal .submodal-close:hover { color: #718096; }

#subscriptionModal .submodal-button.stripe-btn{
  display: inline-flex !important;     /* ensure inline row */
  align-items: center;
  gap: 0px;
  background: #635bff;
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;                  /* keep it on one line */
}

#subscriptionModal .stripe-btn .stripe-logo {
  height: 32px;          /* bigger than before (try 20–24px) */
  width: auto;
  display: inline-block;
  transform: translateY(2px); /* nudges it down to align with text baseline */
}
#subscriptionModal .stripe-btn .btn-chunk{ line-height: 1; }

/* Visually hidden for a11y, but read by screen readers */
#subscriptionModal .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;
}

.submodal-disclaimer {
  background-color: #f5f5f5;   /* light grey */
  color: #555;                 /* softer text */
  font-size: 0.9rem;
  padding: 12px 14px;
  border-radius: 6px;
  margin-top: 16px;
  line-height: 1.4;
}

#subscriptionModal .submodal-card {
  text-align: center;
}

#subscriptionModal .submodal-card p {
  text-align: left; /* keeps paragraphs easy to read */
  margin-left: auto;
  margin-right: auto;
}
