/* ══════════════════════════════════════════════════════════════
   SolisPrime — shared lead-capture modal (solar + EV calculators)
   Brand: navy #033483 · dark navy #021859 · gold #F29F05
   RTL-safe: logical properties only; direction inherited from <html dir>.
   ══════════════════════════════════════════════════════════════ */

.sp-lg-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(2, 24, 89, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (min-width: 560px) {
  .sp-lg-overlay {
    align-items: center;
    padding: 24px 16px;
  }
}

.sp-lg-modal {
  background: #ffffff;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 24px 22px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 40px rgba(2, 24, 89, 0.35);
  text-align: start;
}

@media (min-width: 560px) {
  .sp-lg-modal {
    border-radius: 16px;
    padding: 28px 28px 24px;
    box-shadow: 0 20px 60px rgba(2, 24, 89, 0.4);
  }
}

.sp-lg-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 4px;
}

.sp-lg-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #021859;
  line-height: 1.3;
}

.sp-lg-subtitle {
  margin: 6px 0 16px;
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.45;
}

.sp-lg-close {
  flex: 0 0 auto;
  border: 0;
  background: #eef2f7;
  color: #021859;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.sp-lg-close:hover { background: #dde5ef; }

.sp-lg-field { margin-block-end: 14px; }

.sp-lg-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #021859;
  margin-block-end: 5px;
}

.sp-lg-input,
.sp-lg-select {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  color: #111827;
  background: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sp-lg-input:focus,
.sp-lg-select:focus {
  outline: none;
  border-color: #033483;
  box-shadow: 0 0 0 3px rgba(3, 52, 131, 0.15);
}

.sp-lg-input[aria-invalid="true"],
.sp-lg-select[aria-invalid="true"] {
  border-color: #dc2626;
}

/* Phone stays LTR even in Arabic UI */
.sp-lg-input[type="tel"] {
  direction: ltr;
  text-align: start;
  unicode-bidi: plaintext;
}

.sp-lg-error {
  display: none;
  margin-block-start: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #dc2626;
}

.sp-lg-error.sp-lg-visible { display: block; }

.sp-lg-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-block: 16px 6px;
  font-size: 0.84rem;
  color: #374151;
  line-height: 1.45;
  cursor: pointer;
}

.sp-lg-consent input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-block-start: 1px;
  accent-color: #033483;
  cursor: pointer;
}

.sp-lg-privacy { margin-block-end: 14px; }

.sp-lg-privacy summary {
  font-size: 0.8rem;
  font-weight: 600;
  color: #033483;
  cursor: pointer;
}

.sp-lg-privacy p {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: #4b5563;
  line-height: 1.5;
  background: #f4f7fb;
  border-radius: 8px;
  padding: 10px 12px;
}

.sp-lg-submit {
  display: block;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  background: #F29F05;
  color: #021859;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.sp-lg-submit:hover:not(:disabled) { background: #d98e04; }
.sp-lg-submit:active:not(:disabled) { transform: scale(0.99); }
.sp-lg-submit:disabled { opacity: 0.65; cursor: wait; }

.sp-lg-submit-note {
  margin: 10px 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: #6b7280;
}

/* Honeypot: invisible to humans, present for bots. Not display:none —
   some bots skip hidden fields. */
.sp-lg-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .sp-lg-overlay { animation: sp-lg-fade 0.18s ease-out; }
  .sp-lg-modal { animation: sp-lg-rise 0.22s ease-out; }
  @keyframes sp-lg-fade { from { opacity: 0; } }
  @keyframes sp-lg-rise { from { transform: translateY(24px); opacity: 0; } }
}

@media print {
  .sp-lg-overlay { display: none !important; }
}
