/* ==========================================================================
   "Ask a Free Question" pop-up — loaded on every page (template-parts/ask-modal.php).
   Self-contained: it repeats the few form primitives it needs rather than
   depending on contact.css, which only ever loads on the contact page.
   ========================================================================== */

body.lm-modal-open { overflow: hidden; }

.lm-ask {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lm-ask__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 44, 44, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: lm-ask-fade .18s ease-out;
}

.lm-ask__dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 34px 34px 28px;
  background: var(--warm-cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: lm-ask-rise .22s ease-out;
}

@keyframes lm-ask-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lm-ask-rise {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lm-ask__backdrop,
  .lm-ask__dialog { animation: none; }
}

.lm-ask__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.lm-ask__close:hover { background: var(--blush); color: var(--heading); }

/* --- head ---------------------------------------------------------------- */
.lm-ask__head { text-align: center; margin-bottom: 24px; }

.lm-ask__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--blush);
  color: var(--accent);
}
.lm-ask__icon svg { width: 26px; height: 26px; display: block; }

.lm-ask__eyebrow {
  font-family: var(--font-heading);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
}

.lm-ask__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 6px;
  line-height: 1.25;
}

.lm-ask__lede {
  color: var(--body);
  font-size: .95rem;
  line-height: 1.55;
  margin: 0;
}

.lm-ask__steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}
.lm-ask__stepdot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dusty-rose);
  opacity: .3;
  transition: opacity var(--transition), transform var(--transition);
}
.lm-ask__stepdot.is-active { opacity: 1; transform: scale(1.25); }
.lm-ask__stepdot.is-done { opacity: .65; }
.lm-ask__stepline {
  width: 34px;
  height: 2px;
  border-radius: 2px;
  background: var(--dusty-rose);
  opacity: .3;
}

/* --- form ---------------------------------------------------------------- */
.lm-ask__form { display: block; }

.lm-ask__pane {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.lm-ask__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.lm-ask .form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
}
.lm-ask .form-field > label,
.lm-ask .form-field > legend {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: .92rem;
  color: var(--deep-plum);
  padding: 0;
}
.lm-ask .form-field .req { color: var(--dusty-rose); }

.lm-ask .form-field input[type="text"],
.lm-ask .form-field input[type="tel"],
.lm-ask .form-field input[type="email"],
.lm-ask .form-field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--body);
  background: #fff;
  border: 1px solid rgba(92, 61, 78, 0.16);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.lm-ask .form-field textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.6;
}
.lm-ask .form-field input::placeholder,
.lm-ask .form-field textarea::placeholder { color: var(--muted); }

.lm-ask .form-field input:focus,
.lm-ask .form-field textarea:focus {
  outline: none;
  border-color: var(--dusty-rose);
  box-shadow: 0 0 0 3px rgba(201, 125, 138, 0.18);
}

.lm-ask .form-field input[aria-invalid="true"],
.lm-ask .form-field textarea[aria-invalid="true"] {
  border-color: var(--deep-rose);
  background: #fdf2f4;
}

.lm-ask .field-error {
  color: var(--deep-rose);
  font-size: .84rem;
  font-weight: 500;
}

/* Phone: a fixed "+91" prefix and the number, drawn as one control.
   The country code is not an input — see template-parts/ask-modal.php. */
.lm-ask__phone {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid rgba(92, 61, 78, 0.16);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.lm-ask__phone:focus-within {
  border-color: var(--dusty-rose);
  box-shadow: 0 0 0 3px rgba(201, 125, 138, 0.18);
}
.lm-ask__cc {
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 12px 0 14px;
  border-right: 1px solid rgba(92, 61, 78, 0.16);
  background: var(--warm-cream);
  font-size: 1rem;
  font-weight: 500;
  color: var(--heading);
  white-space: nowrap;
}
.lm-ask .lm-ask__phone input[type="tel"] {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  border-radius: 0;
}
.lm-ask__phone.is-invalid {
  border-color: var(--deep-rose);
  background: #fdf2f4;
}
.lm-ask__phone.is-invalid .lm-ask__cc { background: #fdf2f4; }

/* Select: matched to the text inputs. `appearance: none` drops the native
   caret, so the wrapper draws one from the brand token — a data-URI arrow would
   mean a hardcoded hex, which the theme does not allow. */
.lm-ask__selectwrap { position: relative; }
.lm-ask__selectwrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 2px solid var(--dusty-rose);
  border-bottom: 2px solid var(--dusty-rose);
  border-radius: 1px;
  transform: rotate(45deg);
  pointer-events: none;
}

.lm-ask .lm-ask__select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--body);
  background: #fff;
  border: 1px solid rgba(92, 61, 78, 0.16);
  border-radius: var(--radius-sm);
  padding: 12px 40px 12px 14px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.lm-ask .lm-ask__select:focus {
  outline: none;
  border-color: var(--dusty-rose);
  box-shadow: 0 0 0 3px rgba(201, 125, 138, 0.18);
}
.lm-ask .lm-ask__select[aria-invalid="true"] {
  border-color: var(--deep-rose);
  background: #fdf2f4;
}

/* Consent */
.lm-ask__check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .88rem;
  line-height: 1.5;
  color: var(--body);
  cursor: pointer;
}
.lm-ask__check input {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

.lm-ask__formerror {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #fdecef;
  border: 1px solid var(--deep-rose);
  color: var(--deep-rose);
  font-size: .9rem;
}

/* --- actions ------------------------------------------------------------- */
.lm-ask__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}
.lm-ask__back {
  background: none;
  border: 0;
  padding: 0;
  font-family: var(--font-heading);
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lm-ask__back:hover { color: var(--heading); }
.lm-ask .lm-ask__go {
  margin-left: auto;
  justify-content: center;
}
.lm-ask .lm-ask__go:disabled { opacity: .65; cursor: default; }

/* --- OTP pane ------------------------------------------------------------ */
.lm-ask__otp { text-align: center; }

.lm-ask .lm-ask__code {
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  display: block;
  padding: 14px 10px;
  text-align: center;
  letter-spacing: .5em;
  text-indent: .5em; /* keeps the digits optically centred despite the tracking */
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--heading);
  background: #fff;
  border: 1px solid var(--dusty-rose);
  border-radius: var(--radius-sm);
}
.lm-ask .lm-ask__code:focus {
  outline: none;
  border-color: var(--deep-rose);
  box-shadow: 0 0 0 3px rgba(201, 125, 138, .18);
}

.lm-ask__status {
  margin: 12px 0;
  font-size: .88rem;
  font-weight: 500;
  min-height: 1.2em;
  color: var(--muted);
}
.lm-ask__status.is-ok { color: #1a7f37; }
.lm-ask__status.is-error { color: var(--deep-rose); }

.lm-ask__otp .lm-ask__go { width: 100%; margin-left: 0; }

.lm-ask__switch {
  display: block;
  width: 100%;
  margin: 14px auto 0;
  padding: 0;
  background: none;
  border: 0;
  font-family: var(--font-heading);
  font-size: .88rem;
  font-weight: 500;
  color: var(--deep-plum);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lm-ask__switch:hover:not(:disabled) { color: var(--deep-rose); }
.lm-ask__switch:disabled { color: var(--muted); cursor: default; text-decoration: none; }

.lm-ask__otpfoot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 18px;
}
.lm-ask__link {
  background: none;
  border: 0;
  padding: 0;
  font-size: .86rem;
  font-weight: 500;
  color: var(--deep-rose);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lm-ask__link--muted { color: var(--muted); }
.lm-ask__link:disabled { color: var(--muted); cursor: default; text-decoration: none; }

/* --- thank you ----------------------------------------------------------- */
.lm-ask__done { text-align: center; align-items: center; }
.lm-ask__tick {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto;
}
.lm-ask__tick svg { width: 54px; height: 54px; display: block; }
.lm-ask__donetext {
  margin: 0;
  color: var(--body);
  font-size: .96rem;
  line-height: 1.6;
}
.lm-ask__done .lm-ask__go { margin-left: 0; }

/* --- responsive ---------------------------------------------------------- */
@media (max-width: 560px) {
  .lm-ask { padding: 0; align-items: flex-end; }
  .lm-ask__dialog {
    max-width: none;
    max-height: 94vh;
    padding: 30px 20px 24px;
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .lm-ask__row { grid-template-columns: 1fr; }
  .lm-ask__title { font-size: 1.3rem; }
  .lm-ask__actions { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
  .lm-ask .lm-ask__go { margin-left: 0; width: 100%; }
  .lm-ask__otpfoot { flex-direction: column; gap: 12px; }
}

/* Honeypot — hidden from people, left in the DOM for naive bots to fill.
   Deliberately not display:none: some bots skip hidden inputs. */
.lm-ask .hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
