/* ============================================================================
 * Terms.Law, Structured Intake Engine styles
 * File: /shared/intake-engine.css
 *
 * Uses CLAUDE.md §6 color vars where loaded; falls back to literal values for
 * pages that have not loaded base.css. Mobile-first. Full-screen below 600px.
 * Tap targets >= 44px. No horizontal scroll.
 * ========================================================================== */

.ie-body-lock { overflow: hidden !important; }

.ie-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  z-index: 10001;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  opacity: 0;
  transition: opacity 0.18s ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-y: auto;
}
.ie-overlay.ie-open { opacity: 1; }

.ie-modal {
  background: #ffffff;
  border-radius: 14px;
  max-width: 640px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
  outline: none;
  margin: auto;
  -webkit-overflow-scrolling: touch;
}

/* Header */
.ie-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 24px 18px;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d2b55 60%, #312e81 100%);
  color: #ffffff;
  border-radius: 14px 14px 0 0;
  position: sticky;
  top: 0;
  z-index: 2;
}
.ie-header-text { flex: 1; min-width: 0; }
.ie-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.3;
}
.ie-tagline {
  margin: 6px 0 0;
  font-size: 0.8125rem;
  opacity: 0.86;
  line-height: 1.5;
}
.ie-close {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  margin-left: 12px;
  flex-shrink: 0;
  transition: background 0.15s ease;
  font-family: inherit;
}
.ie-close:hover,
.ie-close:focus { background: rgba(255, 255, 255, 0.22); outline: none; }

/* Form */
.ie-form { padding: 20px 24px 28px; }

.ie-section { margin-bottom: 22px; }
.ie-section:last-of-type { margin-bottom: 0; }
.ie-section-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6366f1;
  margin: 0 0 12px;
}

/* Field */
.ie-field { margin-bottom: 14px; }
.ie-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 6px;
  line-height: 1.4;
}
.ie-req { color: #ef4444; }

.ie-field input[type="text"],
.ie-field input[type="email"],
.ie-field input[type="tel"],
.ie-field input[type="date"],
.ie-field textarea,
.ie-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem; /* 16px to suppress iOS zoom */
  font-family: inherit;
  color: #1f2937;
  background: #ffffff;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 44px;
}
.ie-field textarea { resize: vertical; min-height: 92px; line-height: 1.5; }

.ie-field input:focus,
.ie-field textarea:focus,
.ie-field select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.ie-hint {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 6px;
  line-height: 1.5;
}
.ie-error {
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: 6px;
  min-height: 1em;
  line-height: 1.5;
}
.ie-field-invalid input,
.ie-field-invalid textarea,
.ie-field-invalid select {
  border-color: #ef4444;
  background: #fef2f2;
}

/* Radio group */
.ie-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ie-radio {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
  transition: border-color 0.15s ease, background 0.15s ease;
  font-size: 0.9375rem;
  color: #1f2937;
}
.ie-radio:hover { border-color: #6366f1; background: #f8fafc; }
.ie-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #6366f1;
  flex-shrink: 0;
  margin: 0;
}
.ie-radio input[type="radio"]:checked + span { font-weight: 600; color: #1a1a2e; }
.ie-radio:has(input[type="radio"]:checked) {
  border-color: #6366f1;
  background: #eef2ff;
}

/* Docs checklist */
.ie-docs {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ie-docs li {
  position: relative;
  padding: 8px 0 8px 28px;
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.5;
  border-bottom: 1px solid #f3f4f6;
}
.ie-docs li:last-child { border-bottom: none; }
.ie-docs li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 16px;
  height: 16px;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
}
.ie-docs-note {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.5;
  font-style: italic;
}

/* Tier card */
.ie-tier-card {
  background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 100%);
  border: 1.5px solid #c7d2fe;
  border-radius: 10px;
  padding: 16px 18px;
}
.ie-tier-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.ie-tier-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: #4338ca;
  line-height: 1;
}
.ie-tier-label {
  font-size: 0.875rem;
  color: #312e81;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}
.ie-tier-note {
  margin: 10px 0 0;
  font-size: 0.8125rem;
  color: #4b5563;
  line-height: 1.55;
}

/* Actions */
.ie-actions {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}
.ie-submit {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  font-family: inherit;
  min-height: 48px;
  letter-spacing: 0.01em;
}
.ie-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(79, 70, 229, 0.32); }
.ie-submit:focus { outline: 2px solid #c7d2fe; outline-offset: 2px; }
.ie-submit:disabled { opacity: 0.65; cursor: not-allowed; transform: none; box-shadow: none; }

.ie-disclaimer {
  margin: 12px 0 0;
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.55;
  text-align: center;
}

/* Network error */
.ie-network-error {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  color: #991b1b;
  padding: 12px 16px;
  font-size: 0.875rem;
  border-radius: 0;
  text-align: center;
  line-height: 1.5;
}

/* Confirmation */
.ie-modal-confirm .ie-confirm-body {
  padding: 30px 28px 32px;
  text-align: center;
}
.ie-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #dcfce7;
  color: #15803d;
  font-size: 2rem;
  font-weight: 700;
}
.ie-confirm-message {
  font-size: 0.9375rem;
  color: #1f2937;
  line-height: 1.6;
  margin: 0 0 20px;
}
.ie-confirm-tier {
  background: #eef2ff;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 16px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ie-confirm-tier .ie-tier-price { color: #4338ca; }
.ie-confirm-tier .ie-tier-label { color: #312e81; flex: 0 1 auto; }

.ie-confirm-note {
  font-size: 0.8125rem;
  color: #6b7280;
  margin: 0 0 14px;
  line-height: 1.55;
}

.ie-confirm-cta { margin: 0 0 12px; }
.ie-paypal-cta {
  display: inline-block;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 20px;
  background: linear-gradient(135deg, #0070ba 0%, #0099d8 100%);
  color: #ffffff !important;
  text-decoration: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  min-height: 48px;
  line-height: 1.4;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.ie-paypal-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 112, 186, 0.34);
}

.ie-confirm-fine {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: #9ca3af;
  line-height: 1.55;
}

/* Mobile: full-screen below 600px */
@media (max-width: 600px) {
  .ie-overlay {
    padding: 0;
    align-items: stretch;
  }
  .ie-modal {
    max-width: 100%;
    width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }
  .ie-header {
    border-radius: 0;
    padding: 18px 18px 14px;
  }
  .ie-header h2 { font-size: 1rem; }
  .ie-tagline { font-size: 0.75rem; }
  .ie-form { padding: 18px 18px 24px; }
  .ie-modal-confirm .ie-confirm-body { padding: 28px 20px 28px; }
}

/* Print-hide */
@media print {
  .ie-overlay { display: none !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ie-overlay,
  .ie-submit,
  .ie-paypal-cta { transition: none; }
}
