/* ============================================
   CONSULTATION POPUP STYLES
   Full-screen overlay popup for consultation form.
   Depends on: homepage-styles.css (design tokens, fonts, resets).
   ============================================ */

/* ============================================
   2. POPUP OVERLAY (FULL SCREEN)
   ============================================ */

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--body-bg-color);
  z-index: 9999;
  opacity: 1;
  transition: opacity var(--transition-speed) ease;
}

.popup-overlay.closing {
  opacity: 0;
}

/* ============================================
   3. RETURN BUTTON (TOP RIGHT)
   ============================================ */

/* Positional wrapper for the fixed back button on popup pages.
   Visual styles from .btn-cta — always use class="btn-cta return-btn" in HTML. */
.return-btn {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: 10000;
  padding: 10px 20px;
}

@media (max-width: 768px) {
  .return-btn {
    top: var(--space-3);
    right: var(--space-3);
    padding: 8px 14px;
    font-size: 0.65rem;
  }
}

/* ============================================
   4. MAIN POPUP CONTAINER
   ============================================ */

.popup-container {
  width: 100%;
  height: 100%;
  max-width: 1400px; /* Prevent columns from spreading too far on large screens */
  margin: 0 auto; /* Center the container */
  display: grid;
  grid-template-columns: 1fr 1fr; /* 50/50 on desktop */
}

@media (max-width: 1024px) {
  .popup-container {
    grid-template-columns: 1fr; /* Stack on mobile/tablet */
    overflow-y: auto;
    max-width: 100%; /* Remove max-width on mobile */
  }
}

/* ============================================
   5. LEFT COLUMN (FORM)
   ============================================ */

.popup-left-column {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 4rem 3rem;
  background: var(--body-bg-color);
  position: relative;
  z-index: 2;
  overflow-y: auto;
  overflow-x: hidden;
}



/* NEW: Opacity Wrapper for Mobile */
.content-opacity-wrapper {
  /* No special styling on desktop - just a wrapper */
}


.popup-logo {
  width: 200px; /* Bigger than before (was 120px) */
  height: auto;
  margin: 0 auto 2rem auto; /* Centered with auto margins */
  display: block; /* Required for auto margins to work */
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.popup-left-column h1 {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.popup-subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

/* Mobile: Translucent form overlay */
@media (max-width: 1024px) {
  .popup-left-column {
    background: transparent; /* No background on outer container */
    padding: 0;
    min-height: 100vh;
    padding-bottom: 1200px;
    position: relative;
  }

  /* NEW: Content wrapper gets the translucent background */
  .content-opacity-wrapper {
    background: rgba(255, 255, 255, 0.6); /* 60% opacity - ADJUST THIS TO EXPERIMENT */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 2rem;
  }

  body.dark-mode .content-opacity-wrapper {
    background: rgba(12, 26, 44, 0.9); /* 90% opacity - ADJUST THIS TO EXPERIMENT */
  }

  .popup-logo {
    width: 140px; /* Bigger on mobile too (was 80px) */
    margin: 0 auto 1.5rem auto;
  }

  .popup-left-column h1 {
    padding: 0; /* was 0 15rem — that 240px padding forced the wrapper wider than the viewport,
                   squishing the headline and pushing the subtitle/note/button off-screen */
  }

}

/* NEW: Small screen adjustments (iPhone 11 = 375px) */
@media (max-width: 400px) {
  .content-opacity-wrapper {
    padding: 1.5rem 1rem;
  }

  .popup-left-column h1 {
    font-size: 2.1rem;
  }
}

/* ============================================
   6. FORM STYLES
   ============================================ */

.form-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto; /* Center the form */
}

/* NEW: Smaller form width on very small screens */
@media (max-width: 400px) {
  .form-container {
    max-width: 100%;
    padding: 0 0.5rem;
  }

  .form-group,
  .form-checkboxes,
  .required-note,
  .cf-turnstile {
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 401px) and (max-width: 600px) {
  .form-group,
  .form-checkboxes,
  .required-note,
  .cf-turnstile {
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
  }
}

.form-group {
  margin-bottom: 1.5rem;
}

/* NEW: Reduce spacing on small screens */
@media (max-width: 400px) {
  .form-group {
    margin-bottom: 1rem;
  }
}

/* Required asterisk */
.required-asterisk {
  color: var(--color-second);
  margin-left: 0.25rem;
  font-weight: bold;
}

/* Prefill hint under the message field (shown only when the value-finder
   widget pre-fills the textarea, so users review rather than overwrite it) */
.form-prefill-note {
  font-size: 0.8125rem;
  color: var(--color-second);
  margin: 0.5rem 0 0 0;
  font-style: italic;
  line-height: 1.4;
}
.form-prefill-note[hidden] { display: none; }

/* Required note before submit */
.required-note {
  font-size: 0.8125rem;
  color: var(--text-color);
  opacity: 0.7;
  margin: 1rem 0 0.5rem 0;
  font-style: italic;
  text-align: left; /* align with the left edge of the form fields, not centered */
}

/* Field, label and focus styles come from .form-group in design-system.css. */

/* NEW: Checkbox Styles */
.form-checkboxes {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.checkbox-group:last-child {
  margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  margin-top: 0.25rem;
  flex-shrink: 0;
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.checkbox-group label {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-color);
  cursor: pointer;
  line-height: 1.4;
  margin-bottom: 0;
}

/* NEW: Smaller checkboxes on small screens */
@media (max-width: 400px) {
  .form-checkboxes {
    margin-top: 1rem;
    margin-bottom: 1rem;
  }

  .checkbox-group {
    gap: 0.5rem;
  }

  .checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
  }

  .checkbox-group label {
    font-size: 0.8125rem;
  }
}

/* Form submit buttons are full-width inside popup forms.
   display:flex (block-level) — NOT the base .btn-cta inline-flex — so the
   margin-left/right:auto in the mobile breakpoints actually centers the button
   in the form column. On an inline-flex box auto margins compute to 0, which
   left-shifted the button ~7px out of line with the inputs above it. */
.form-container .btn-cta {
  display: flex;
  width: 100%;
  margin-top: 1rem;
  justify-content: center;
}

/* NEW: Smaller subtitle on small screens */
@media (max-width: 400px) {
  .popup-subtitle {
    font-size: 0.8125rem;
  }
}

/* ============================================
   7. SUCCESS MESSAGE
   ============================================ */

.success-container {
  text-align: center;
  max-width: 500px;
  padding: 3rem 2rem;
}

.success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 2rem;
  background: var(--color-second);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
  animation: successPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes successPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.success-container h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--heading-color);
  margin-bottom: 1rem;
}

.success-container p {
  font-size: 1.125rem;
  color: var(--text-color);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.success-note {
  font-size: 0.875rem;
  opacity: 0.7;
  font-style: italic;
}

/* ============================================
   8. RIGHT COLUMN (DIAGRAM ANIMATION)
   ============================================ */

.popup-right-column {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  background: var(--body-bg-color);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Mobile: Fixed background */
@media (max-width: 1024px) {
  .popup-right-column {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Behind form overlay */
    opacity: 1; /* Full opacity - no fading */
  }
}

/* ============================================
   10. LANGUAGE-SPECIFIC ADJUSTMENTS
   ============================================ */

body.lang-hy .popup-left-column h1 { font-size: 90%; }
body.lang-hy .form-group label { font-size: 90%; }
body.lang-hy .btn-cta { font-size: 90%; }
body.lang-hy .popup-subtitle { font-size: 90%; }
body.lang-hy .success-container h2 { font-size: 90%; }
body.lang-hy .success-container p { font-size: 90%; }
body.lang-hy .checkbox-group label { font-size: 90%; }

/* ============================================
   12. LOADING STATE (OPTIONAL)
   ============================================ */

.btn-cta.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-cta.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 0.5rem;
}

