/* =====================================================================
   SaralDesk – "Talk to Sales" popup
   Uses the design tokens from site.css (navy/red, Outfit + Plus Jakarta
   Sans, radius and shadow scale). Everything is scoped to .sd-modal.
   ===================================================================== */

.sd-modal[hidden], .sd-modal [hidden] { display: none !important; }

html.sd-modal-open, html.sd-modal-open body { overflow: hidden; }
html.sd-modal-open body { padding-right: var(--sd-scrollbar, 0px); }
html.sd-modal-open #navbar { padding-right: var(--sd-scrollbar, 0px); }

.sd-modal {
  position: fixed; inset: 0; z-index: 1300;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.sd-modal-overlay {
  position: absolute; inset: 0;
  background: rgba(15,20,40,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.25s ease;
}
.sd-modal-dialog {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: 0 32px 100px rgba(10,18,53,0.35);
  overflow: hidden;
  opacity: 0; transform: translateY(14px) scale(0.98);
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.2,0.8,0.2,1);
  outline: none;
}
.sd-modal.is-open .sd-modal-overlay { opacity: 1; }
.sd-modal.is-open .sd-modal-dialog { opacity: 1; transform: none; }

.sd-modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--light);
  display: flex; align-items: center; justify-content: center;
  color: var(--navy); font-size: 16px; cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.sd-modal-close:hover { background: var(--light2); border-color: var(--navy); transform: rotate(90deg); }

.sd-modal-scroll { overflow-y: auto; overscroll-behavior: contain; flex: 1; -webkit-overflow-scrolling: touch; }
.sd-modal-grid { display: grid; grid-template-columns: 5fr 7fr; min-height: 100%; }

/* ---------- Left: pitch (matches the CTA banner) ---------- */
.sd-modal-aside {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 55%, #0a1235 100%);
  color: white; padding: 48px 40px;
}
.sd-modal-aside::before {
  content: ''; position: absolute; top: -90px; right: -90px; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,25,75,0.22), transparent 70%);
}
.sd-modal-aside::after {
  content: ''; position: absolute; bottom: -80px; left: -80px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(74,48,128,0.25), transparent 70%);
}
.sd-modal-aside > * { position: relative; z-index: 1; }
.sd-modal-aside .eyebrow { color: rgba(255,255,255,0.75); background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }
.sd-modal-title {
  font-family: var(--font-display); font-size: clamp(24px, 2.6vw, 30px); font-weight: 800;
  line-height: 1.2; color: white; margin-bottom: 14px;
}
.sd-modal-lead { font-size: 15px; line-height: 1.7; color: rgba(255,255,255,0.68); margin-bottom: 28px; }
.sd-modal-points { display: flex; flex-direction: column; gap: 14px; }
.sd-modal-points li { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.9); }
.sd-point-icon {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  color: #ff6b8a; font-size: 14px;
}

/* ---------- Right: form ---------- */
.sd-modal-main { padding: 44px 40px 36px; position: relative; }
.sd-form { display: flex; flex-direction: column; gap: 16px; }
.sd-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sd-field { display: flex; flex-direction: column; min-width: 0; }
.sd-label { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 7px; }
.sd-req { color: var(--red); }
.sd-optional { color: var(--text3); font-weight: 500; font-size: 12px; }
.sd-input {
  width: 100%;
  font-family: var(--font-body); font-size: 15px; color: var(--text);
  background: var(--white);
  border: 1.5px solid rgba(27,43,107,0.18); border-radius: 10px;
  padding: 12px 14px; line-height: 1.4;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none; appearance: none;
}
.sd-input::placeholder { color: var(--text3); opacity: 1; }
.sd-input:hover { border-color: rgba(27,43,107,0.32); }
.sd-input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(27,43,107,0.12); }
.sd-textarea { resize: vertical; min-height: 92px; }
.sd-field.has-error .sd-input { border-color: var(--red); background: rgba(232,25,75,0.03); }
.sd-field.has-error .sd-input:focus { box-shadow: 0 0 0 4px rgba(232,25,75,0.14); }
.sd-field-error {
  font-size: 12.5px; font-weight: 600; color: var(--red-dark);
  margin-top: 6px; display: none; align-items: center; gap: 6px;
}
.sd-field.has-error .sd-field-error { display: flex; }
.sd-field-error::before { content: '\f06a'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 12px; }
.sd-hint { font-size: 12px; color: var(--text3); margin-top: 6px; }
.sd-field.has-error .sd-hint { display: none; }

/* Phone with fixed +91 prefix */
.sd-phone { position: relative; }
.sd-phone-prefix {
  position: absolute; left: 1.5px; top: 1.5px; bottom: 1.5px;
  display: flex; align-items: center; padding: 0 12px;
  font-size: 15px; font-weight: 700; color: var(--navy);
  background: var(--light); border-right: 1.5px solid rgba(27,43,107,0.12);
  border-radius: 8.5px 0 0 8.5px; pointer-events: none;
  z-index: 2; /* CF7 wraps inputs in a positioned span that would paint over the prefix */
}
.sd-phone .sd-input { padding-left: 64px; }

/* Searchable city combobox */
.sd-combo { position: relative; }
.sd-combo .sd-input { padding-right: 42px; }
.sd-combo-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: none; background: transparent; border-radius: 8px;
  color: var(--text3); cursor: pointer; font-size: 12px;
}
.sd-combo-toggle:hover { color: var(--navy); background: var(--light); }
.sd-combo-input[aria-expanded="true"] + .sd-combo-toggle i { transform: rotate(180deg); }
.sd-combo-toggle i { transition: transform 0.2s; }
.sd-combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5;
  max-height: 240px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--white); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-md); padding: 6px;
}
.sd-combo-option {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.sd-combo-option small { font-size: 12px; font-weight: 500; color: var(--text3); white-space: nowrap; }
.sd-combo-option.is-active, .sd-combo-option:hover { background: var(--light); color: var(--navy); }
.sd-combo-option[aria-selected="true"] { color: var(--navy); }
.sd-combo-option mark { background: rgba(232,25,75,0.12); color: inherit; border-radius: 3px; padding: 0 1px; }
.sd-combo-custom { color: var(--red); }
.sd-combo-empty { padding: 10px 12px; font-size: 13px; color: var(--text3); }

/* Honeypot – off-screen, not display:none (some bots skip hidden fields) */
.sd-hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Send button – same look as .btn-primary-lg */
.sd-btn-primary {
  font-family: var(--font-body); font-size: 15px; font-weight: 700; color: white;
  background: var(--navy); border: none; border-radius: 12px;
  padding: 14px 30px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: all 0.25s;
  box-shadow: 0 4px 20px rgba(27,43,107,0.25);
}
.sd-btn-primary:hover { background: var(--red); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(232,25,75,0.35); }
.sd-submit { width: 100%; margin-top: 4px; }
.sd-submit[disabled] { cursor: progress; opacity: 0.85; transform: none; background: var(--navy); box-shadow: none; }
.sd-submit.is-loading i { display: none; }
.sd-submit.is-loading::after {
  content: ''; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: white;
  animation: sdSpin 0.7s linear infinite;
}
@keyframes sdSpin { to { transform: rotate(360deg); } }

.sd-form-privacy { font-size: 12px; color: var(--text3); text-align: center; }
.sd-form-privacy i { font-size: 11px; margin-right: 4px; }

.sd-form-alert {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(232,25,75,0.06); border: 1px solid rgba(232,25,75,0.2);
  color: var(--red-dark); border-radius: 10px; padding: 12px 14px;
  font-size: 13.5px; font-weight: 600; line-height: 1.5;
}
.sd-form-alert::before { content: '\f071'; font-family: 'Font Awesome 6 Free'; font-weight: 900; }

.sd-form-wrap > .sd-form-alert { margin-bottom: 16px; }

/* ---------- Contact Form 7 markup inside the popup ---------- */
.sd-modal .wpcf7-form-control-wrap { display: block; }
/* The popup shows its own inline errors, alert and success panel. */
.sd-modal .wpcf7-not-valid-tip,
.sd-modal .wpcf7-response-output,
.sd-modal .wpcf7-spinner { display: none !important; }
.sd-modal .hidden-fields-container { display: none; border: 0; padding: 0; margin: 0; }

/* ---------- Success state ---------- */
.sd-success {
  min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px 8px; outline: none;
  animation: sdFadeUp 0.35s ease;
}
.sd-success-icon {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(34,197,94,0.12); color: #16a34a; font-size: 30px;
  margin-bottom: 20px; box-shadow: 0 0 0 10px rgba(34,197,94,0.06);
}
.sd-success-title { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--navy); margin-bottom: 10px; }
.sd-success-text { font-size: 15px; color: var(--text2); line-height: 1.7; max-width: 380px; margin-bottom: 28px; }
@keyframes sdFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Hindi: Devanagari for the popup's own font stacks */
html[lang="hi"] .sd-input, html[lang="hi"] .sd-btn-primary { font-family: 'Noto Sans Devanagari', var(--font-body); }

/* ---------- Tablet ---------- */
@media (max-width: 900px) {
  .sd-modal-dialog { width: min(640px, 100%); }
  .sd-modal-grid { grid-template-columns: 1fr; }
  .sd-modal-aside { padding: 32px 32px 28px; }
  .sd-modal-aside .sd-modal-title { padding-right: 40px; }
  .sd-modal-lead { margin-bottom: 18px; }
  .sd-modal-points { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
  .sd-modal-points li { font-size: 13px; }
  .sd-modal-main { padding: 32px; }
  /* Dark translucent chip: readable over the navy header and over the white form once scrolled. */
  .sd-modal-close { background: rgba(15,26,70,0.72); border-color: rgba(255,255,255,0.28); color: white; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 4px 14px rgba(10,18,53,0.25); }
  .sd-modal-close:hover { background: rgba(15,26,70,0.9); border-color: rgba(255,255,255,0.5); }
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .sd-modal { padding: 12px; align-items: flex-end; }
  .sd-modal-dialog {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 22px;
    transform: translateY(40px);
  }
  .sd-modal-aside { padding: 24px 20px 20px; }
  .sd-modal-title { font-size: 21px; margin-bottom: 8px; }
  .sd-modal-lead { font-size: 13.5px; line-height: 1.6; margin-bottom: 0; }
  .sd-modal-points { display: none; }
  .sd-modal-main { padding: 22px 20px 24px; }
  .sd-row { grid-template-columns: 1fr; }
  .sd-input, .sd-phone-prefix { font-size: 16px; } /* prevents iOS zoom on focus */
  .sd-input { padding: 13px 14px; }
  .sd-phone .sd-input { padding-left: 64px; }
  .sd-combo-list { max-height: 200px; }
  .sd-modal-close { top: 12px; right: 12px; }
}

/* ---------- Dropdown (pricing popup) ---------- */
.sd-select {
  cursor: pointer; padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231B2B6B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 12px 8px;
}
.sd-select:invalid, .sd-select.is-placeholder { color: var(--text3); }
.sd-select option { color: var(--text); }
.sd-plan-hint {
  display: none; align-items: center; gap: 8px; margin-top: 8px;
  font-size: 13px; color: var(--text2);
}
.sd-plan-hint.is-visible { display: flex; }
.sd-plan-hint strong { color: var(--navy); font-family: var(--font-display); font-size: 15px; }
.sd-plan-hint i { color: var(--red); }
.sd-field.has-error .sd-plan-hint { display: none; }
.sd-success-plan {
  display: inline-flex; align-items: center; gap: 6px; margin: -12px 0 26px;
  background: var(--light); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 16px; font-size: 14px; color: var(--text2);
}
.sd-success-plan strong { color: var(--navy); }
