/* ================================================================
   Terawatt 3.0 — Site-wide "Book a Consultation" popup
   Loaded on every front-end page. Modal opens on any element with
   data-popup="consult" or any link to #consult.
   ================================================================ */

.tw-popup {
  position: fixed; inset: 0; z-index: 9990;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease;
}
.tw-popup.is-open { opacity: 1; pointer-events: auto; }
.tw-popup[hidden] { display: none; }

.tw-popup__backdrop {
  position: absolute; inset: 0;
  background: rgba(14, 27, 44, 0.66);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.tw-popup__panel {
  position: relative; z-index: 1;
  max-width: 560px; width: 100%; max-height: 92vh; overflow-y: auto;
  background: var(--c-paper, #F2F0EC);
  color: var(--c-ink, #0C0E12);
  border-radius: 8px;
  border: 1px solid var(--c-line, #DDD9D0);
  box-shadow: 0 28px 70px rgba(0,0,0,.32);
  padding: 36px 32px 28px;
  font-family: var(--font-body, 'Inter', sans-serif);
  transform: translateY(8px);
  transition: transform .18s ease;
}
.tw-popup.is-open .tw-popup__panel { transform: translateY(0); }

.tw-popup__close {
  position: absolute; top: 10px; right: 12px;
  background: transparent; border: 0;
  font-family: var(--font-mono, monospace); font-size: 28px; line-height: 1;
  color: var(--c-muted, #5B6472); cursor: pointer; padding: 8px 12px;
  transition: color .12s;
}
.tw-popup__close:hover { color: var(--c-ink, #0C0E12); }
.tw-popup__close:focus-visible {
  outline: 2px solid var(--c-master-2, #E8B92E); outline-offset: 2px;
}

.tw-popup__head { margin-bottom: 22px; }
.tw-popup__head .eyebrow { margin-bottom: 12px; }
.tw-popup__head h2 {
  font-family: var(--font-display, 'Inter Tight', sans-serif);
  font-weight: 800; font-size: clamp(24px, 4vw, 32px);
  line-height: 1.12; letter-spacing: -0.03em;
  color: var(--c-ink, #0C0E12); margin: 0 0 10px;
}
.tw-popup__head p {
  font-size: 14.5px; line-height: 1.55; color: var(--c-ink-soft, #2C2F36);
  margin: 0; max-width: 46ch;
}

.tw-popup__row { display: grid; gap: 14px; margin-bottom: 14px; }
.tw-popup__row--2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 540px) { .tw-popup__row--2 { grid-template-columns: 1fr; } }

.tw-popup .tw-field { margin-bottom: 14px; }
.tw-popup .tw-field label {
  display: block;
  font-family: var(--font-mono, monospace);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--c-muted, #5B6472); margin-bottom: 5px;
}
.tw-popup .tw-field input,
.tw-popup .tw-field select,
.tw-popup .tw-field textarea {
  width: 100%; padding: 10px 12px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 14.5px; line-height: 1.4;
  background: var(--c-white, #fff);
  color: var(--c-ink, #0C0E12);
  border: 1px solid var(--c-line-strong, #B4AEA1);
  border-radius: 4px;
}
.tw-popup .tw-field input:focus,
.tw-popup .tw-field select:focus,
.tw-popup .tw-field textarea:focus {
  outline: none; border-color: var(--c-ink, #0C0E12);
}
.tw-popup .tw-field textarea { resize: vertical; min-height: 80px; }

.tw-popup__hp { position: absolute; left: -9999px; top: -9999px; opacity: 0; }

.tw-popup__actions {
  display: flex; align-items: center; gap: 16px; margin-top: 18px;
}
/* Saffron is locked across every brand variant — these CTAs must read
   the same regardless of the page's active variant cascade. */
.tw-popup__submit,
.tw-popup__success .btn,
.tw-popup__success .btn--accent {
  background: #E8B92E !important;
  color: #000 !important;
  border: none;
  border-radius: 4px;
  padding: 14px 24px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.005em;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background .15s, transform .12s;
}
.tw-popup__submit:hover,
.tw-popup__success .btn:hover,
.tw-popup__success .btn--accent:hover {
  background: #d9aa1d !important;
}
.tw-popup__submit:focus-visible,
.tw-popup__success .btn:focus-visible {
  outline: 2px solid #0C0E12;
  outline-offset: 2px;
}
.tw-popup__submit:disabled { opacity: 0.6; cursor: progress; }

.tw-popup__status {
  font-family: var(--font-mono, monospace); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--c-muted, #5B6472);
}
.tw-popup__status[data-state="error"] { color: #c0392b; text-transform: none; letter-spacing: 0; font-family: inherit; font-size: 13.5px; }

.tw-popup__legal {
  margin: 14px 0 0; font-size: 11.5px; line-height: 1.5;
  color: var(--c-faint, #8C9099);
}

.tw-popup__success {
  text-align: left;
}
.tw-popup__success h2 {
  font-family: var(--font-display, 'Inter Tight', sans-serif);
  font-weight: 800; font-size: 28px; line-height: 1.15;
  letter-spacing: -0.03em; margin: 12px 0 12px;
}
.tw-popup__success p {
  font-size: 15px; line-height: 1.55; color: var(--c-ink-soft, #2C2F36);
  margin: 0 0 22px;
}
.tw-popup__success a { color: inherit; border-bottom: 1px solid currentColor; text-decoration: none; }

/* Body scroll-lock when popup open */
html.tw-popup-open, html.tw-popup-open body { overflow: hidden; }

/* Reduce motion respect */
@media (prefers-reduced-motion: reduce) {
  .tw-popup, .tw-popup__panel, .tw-popup__submit { transition: none; }
}

/* ----------------------------------------------------------------
   Consultation CTA — drop-in widget+shortcode that opens the popup
   (rendered by inc/consult-cta.php).
   ---------------------------------------------------------------- */

.tw3-consult-cta {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tw3-consult-cta--align-left   { align-items: flex-start; text-align: left; }
.tw3-consult-cta--align-center { align-items: center;     text-align: center; }
.tw3-consult-cta--align-right  { align-items: flex-end;   text-align: right; }

.tw3-consult-cta__copy { max-width: 56ch; }
.tw3-consult-cta__copy .eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #E8B92E; /* locked saffron */
}
.tw3-consult-cta__headline {
  margin: 0 0 10px;
  font-family: var(--font-display, 'Inter Tight', sans-serif);
  font-weight: 800;
  font-size: clamp(22px, 3.4vw, 32px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--c-ink, #0C0E12);
}
.tw3-consult-cta__support {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--c-ink-soft, #2C2F36);
}

/* Locked-saffron button — !important so brand variant cascades can't
   override the conversion CTA's contrast. */
.tw3-consult-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #E8B92E !important;
  color: #000 !important;
  border: 0;
  border-radius: 4px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-weight: 700;
  letter-spacing: -0.005em;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .12s;
}
.tw3-consult-cta--size-medium .tw3-consult-cta__btn { padding: 10px 18px; font-size: 13.5px; }
.tw3-consult-cta--size-large  .tw3-consult-cta__btn { padding: 14px 24px; font-size: 14.5px; }
.tw3-consult-cta__btn:hover { background: #d9aa1d !important; }
.tw3-consult-cta__btn:focus-visible {
  outline: 2px solid #0C0E12;
  outline-offset: 2px;
}
.tw-cta-arrow { display: inline-block; flex: 0 0 auto; }

/* Section-wrapped variant — modest section padding so the CTA isn't
   pinned to the page edges when used standalone. */
.tw3-consult-cta-section { padding: clamp(40px, 6vw, 72px) 0; }
