/* RoofLeadHQ — native forms styling.
 * Layers on top of styles.css + Tailwind CDN. Matches the E1 email design:
 * navy banner + round logo, light page, white cards, navy accent. Inputs are
 * white with dark text. Class names are unchanged so the existing HTML/JS work.
 */

:root {
  --rlhq-navy: #16294a;
  --rlhq-navy-dark: #0f1d38;
  --rlhq-bg: #f4f6f9;
  --rlhq-text: #1f2937;
  --rlhq-muted: #64748b;
  --rlhq-border: #e2e8f0;
}

.rlhq-form-page {
  min-height: 100vh;
  background: var(--rlhq-bg);
  color: var(--rlhq-text);
}

/* Branded banner (navy, centered round logo) — matches the E1 email header. */
.rlhq-banner {
  background: var(--rlhq-navy);
  text-align: center;
  padding: 30px 24px 26px;
}
.rlhq-banner img {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #ffffff;
  display: inline-block;
  border: 0;
}
.rlhq-banner-title {
  color: #ffffff;
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  margin: 14px 0 6px;
}
.rlhq-banner-sub {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
  margin: 0;
  line-height: 1.5;
}

.rlhq-form-card {
  background: #ffffff;
  border: 1px solid var(--rlhq-border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

/* Header logo badge (used where a small inline logo is still shown). */
.rlhq-logo-badge {
  display: block;
  height: 48px;
  width: 48px;
  border-radius: 50%;
}
@media (max-width: 480px) {
  .rlhq-logo-badge { height: 40px; width: 40px; }
  .rlhq-banner-title { font-size: 1.35rem; }
}

/* Field labels + hints */
.rlhq-label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: var(--rlhq-navy);
}

.rlhq-required {
  color: #dc2626;
  margin-left: 2px;
}

.rlhq-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--rlhq-muted);
  margin-bottom: 0.5rem;
}

/* Inputs / selects / textarea */
.rlhq-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: #ffffff;
  color: var(--rlhq-text);
  border: 1px solid var(--rlhq-border);
  border-radius: 0.75rem;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
}

.rlhq-input::placeholder {
  color: #94a3b8;
}

.rlhq-input:focus {
  outline: none;
  border-color: var(--rlhq-navy);
  box-shadow: 0 0 0 3px rgba(22, 41, 74, 0.14);
}

/* Invalid state */
.rlhq-input.rlhq-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.rlhq-field-error {
  display: none;
  color: #dc2626;
  font-size: 0.8rem;
  margin-top: 0.35rem;
  font-weight: 600;
}

.rlhq-field-error.rlhq-show { display: block; }

/* Radio (plan) + checkbox (legal) groups */
.rlhq-choice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--rlhq-border);
  border-radius: 0.75rem;
  background: var(--rlhq-bg);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.rlhq-choice:hover {
  border-color: var(--rlhq-navy);
}

.rlhq-choice input {
  margin-top: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--rlhq-navy);
  flex-shrink: 0;
}

.rlhq-choice-body {
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--rlhq-text);
}

.rlhq-choice-price {
  color: var(--rlhq-muted);
  font-size: 0.85rem;
}

.rlhq-group-error.rlhq-show { display: block; }

/* Section headings */
.rlhq-section-title {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.15rem;
  color: var(--rlhq-navy);
}

/* Submit button + loading state */
.rlhq-submit {
  width: 100%;
  padding: 1.1rem 1rem;
  background: var(--rlhq-navy);
  color: #ffffff;
  font-weight: 800;
  font-size: 1.05rem;
  border: none;
  border-radius: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.rlhq-submit:hover:not(:disabled) {
  background: var(--rlhq-navy-dark);
  transform: translateY(-1px);
}

.rlhq-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.rlhq-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #ffffff;
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: -2px;
  animation: rlhq-spin 0.7s linear infinite;
}

@keyframes rlhq-spin {
  to { transform: rotate(360deg); }
}

/* "Next step" confirmation panel */
.rlhq-next-step {
  display: none;
  border: 1px solid var(--rlhq-border);
  background: var(--rlhq-bg);
  border-radius: 1rem;
  padding: 1.25rem 1.25rem;
  color: var(--rlhq-text);
}

.rlhq-next-step.rlhq-show { display: block; }

/* Dry-run / status panel — error + "service unavailable" states. */
.rlhq-form-status {
  display: none;
  border-radius: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid transparent;
}

.rlhq-form-status.rlhq-show { display: block; }

.rlhq-form-status--error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.rlhq-form-status--warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.rlhq-status-title {
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.rlhq-status-body {
  font-size: 0.85rem;
}

.rlhq-status-link {
  color: var(--rlhq-navy);
  font-weight: 700;
}

/* Honeypot — visually hidden, off-screen, not display:none so bots fill it */
.rlhq-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .rlhq-spinner { animation-duration: 0.001ms; }
  .rlhq-submit:hover:not(:disabled) { transform: none; }
}
