/* ──────────────────────────────────────────
   GRAVITY FORMS — estimate forms
   Gravity Forms' own CSS is turned off on landing pages (inc/gravity-forms.php),
   so the original .hc-* / .ff-* styles in main.css do most of the work.
   This file adds layout, states and the bits GF adds.
────────────────────────────────────────── */

.nb-estimate_wrapper { margin: 0; }
.nb-estimate_wrapper .gform_heading,
.nb-estimate_wrapper .gform_required_legend,
.nb-estimate_wrapper .gform_validation_container,
.nb-estimate_wrapper .gfield--type-hidden,
.nb-estimate_wrapper .gfield--type-honeypot { display: none !important; }

.gform_wrapper .screen-reader-text,
.gform_wrapper .hidden_label .gfield_label {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* 12-column grid, so GF's "half width" setting works */
.nb-estimate_wrapper .gform_fields {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 14px;
}
.nb-estimate--footer_wrapper .gform_fields { gap: 12px; } /* original .ff-row: grid gap + field margin */
.nb-estimate--footer_wrapper .gform_footer { padding: 12px 0; }
.nb-estimate_wrapper .gfield { grid-column: 1 / -1; min-width: 0; }
.nb-estimate_wrapper .gfield--width-half { grid-column: span 6; }
.nb-estimate_wrapper .gfield--width-third { grid-column: span 4; }
.nb-estimate_wrapper .gfield--width-quarter { grid-column: span 3; }

@media (max-width: 900px) {
  .nb-estimate--footer_wrapper .gfield { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .nb-estimate--hero_wrapper .gfield { grid-column: 1 / -1; }
}

/* labels */
.nb-estimate_wrapper .gfield_label { display: block; }
.nb-estimate_wrapper .gfield_required { color: var(--fire); margin-left: 3px; }

/* inputs inside the icon rows */
.hc-input-row input, .hc-input-row select,
.ff-inp-row input, .ff-inp-row select { width: 100%; min-width: 0; }
.hc-input-row input[type="date"],
.ff-inp-row input[type="date"] { color: var(--ink); appearance: none; -webkit-appearance: none; }
.ff-textarea textarea { display: block; }

/* footer of the form */
.nb-estimate_wrapper .gform_footer,
.nb-estimate_wrapper .gform-footer { margin: 0; padding: 0; display: block; }
.nb-estimate_wrapper .btn-hc-submit[disabled],
.nb-estimate_wrapper .btn-ff[disabled] { opacity: .7; cursor: wait; transform: none; }

/* loading spinner GF shows while submitting */
.nb-estimate_wrapper .gform-loader,
.nb-estimate_wrapper .gform_ajax_spinner {
  display: block; width: 22px; height: 22px; margin: 14px auto 0;
  border: 2.5px solid var(--fire-glow); border-top-color: var(--fire);
  border-radius: 50%; animation: nb-spin .8s linear infinite;
  font-size: 0; color: transparent;
}
@keyframes nb-spin { to { transform: rotate(360deg); } }

/* validation */
.nb-estimate_wrapper .gform_validation_errors {
  background: #FDF0EE; border: 1.5px solid #F4C7BF; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 16px;
  font-size: 13px; color: #B42318; line-height: 1.5;
}
.nb-estimate_wrapper .gform_validation_errors h2,
.nb-estimate_wrapper .gform_submission_error { font-size: 13px; font-weight: 700; font-family: inherit; color: #B42318; display: flex; gap: 6px; align-items: center; }
.nb-estimate_wrapper .gform_validation_errors ol { margin: 6px 0 0 18px; }
.nb-estimate_wrapper .gform_validation_errors a { color: inherit; text-decoration: underline; }
.nb-estimate_wrapper .gform-icon { display: none; }
.nb-estimate_wrapper .gform_validation_errors:focus { outline: none; }
.nb-estimate_wrapper .gfield_error .hc-input-row,
.nb-estimate_wrapper .gfield_error .ff-inp-row { border-color: #D64531; background: #fff; }
.nb-estimate_wrapper .gfield_validation_message,
.nb-estimate_wrapper .validation_message {
  font-size: 12px; font-weight: 600; color: #B42318; margin-top: 6px;
}
.nb-estimate_wrapper .instruction { font-size: 11px; color: var(--ink-60); margin-top: 6px; }

/* ── SUCCESS (matches the original "You're all set!" card) ── */
:is(.hero-card, .ff-form-card) .gform_confirmation_message {
  text-align: center; padding: 32px 16px; color: var(--ink);
}
:is(.hero-card, .ff-form-card) .gform_confirmation_message::before {
  content: ''; display: block;
  width: 60px; height: 60px; border-radius: 50%;
  margin: 0 auto 16px;
  background: var(--fire-glow) no-repeat center / 28px 28px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E8541A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
}
:is(.hero-card, .ff-form-card) .gform_confirmation_message h3 {
  font-family: 'Playfair Display', serif;
  font-size: 22px; font-weight: 900; margin-bottom: 8px;
}
:is(.hero-card, .ff-form-card) .gform_confirmation_message p {
  font-size: 14px; color: var(--ink-60); max-width: 300px;
  margin: 0 auto 20px; line-height: 1.7;
}
:is(.hero-card, .ff-form-card) .gform_confirmation_message .btn-call {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff;
  font-size: 16px; font-weight: 700;
  padding: 14px 28px; border-radius: 10px;
  transition: background var(--t);
}
:is(.hero-card, .ff-form-card) .gform_confirmation_message .btn-call:hover { background: #1c2b3a; }
:is(.hero-card, .ff-form-card) .gform_confirmation_message .btn-call::before {
  content: ''; width: 16px; height: 16px; flex-shrink: 0;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E8541A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07A19.5 19.5 0 013.09 10.8a19.79 19.79 0 01-3.07-8.67A2 2 0 012 0h3a2 2 0 012 1.72 12.84 12.84 0 00.7 2.81 2 2 0 01-.45 2.11L6.09 7.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45 12.84 12.84 0 002.81.7A2 2 0 0122 14v3z'/%3E%3C/svg%3E");
}

/* After submitting, only the success message shows in the card (like the original). */
.hero-card:has(.gform_confirmation_wrapper) .hc-eyebrow,
.hero-card:has(.gform_confirmation_wrapper) .hc-title,
.hero-card:has(.gform_confirmation_wrapper) .hc-note,
.ff-form-card:has(.gform_confirmation_wrapper) .ff-form-title,
.ff-form-card:has(.gform_confirmation_wrapper) .ff-form-sub,
.ff-form-card:has(.gform_confirmation_wrapper) .ff-disc { display: none; }

/* Admin-only notice when the form isn't set up */
.nb-form-missing {
  font-size: 13px; line-height: 1.5; color: #8a4b00;
  background: #FFF6E5; border: 1.5px dashed #F0B54A; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 14px;
}
.nb-form-missing a { text-decoration: underline; }

/* ── Plain pages (Privacy Policy, etc.) ── */
.nb-page { background: var(--sand); padding: 72px 24px 96px; }
.nb-page-inner { max-width: 760px; margin: 0 auto; }
.nb-page-title {
  font-family: 'Playfair Display', serif; font-size: 40px; line-height: 1.15;
  margin-bottom: 28px;
}
.nb-page-content { font-size: 16px; line-height: 1.8; color: var(--ink); }
.nb-page-content > * + * { margin-top: 1em; }
.nb-page-content h2, .nb-page-content h3 { font-family: 'Playfair Display', serif; margin-top: 1.6em; }
.nb-page-content a { color: var(--fire); text-decoration: underline; }
.nb-page-content ul, .nb-page-content ol { padding-left: 1.4em; }
