/* ══ Pre-3D Tool gatekeeper (includes/gate-3d.php) ══
   Loaded on both the main site and the standalone /custom-quote page, so
   everything is scoped under .g3d-modal and sets its own fonts/sizes rather
   than relying on either page's stylesheet. */
.g3d-lock, .g3d-lock body { overflow: hidden; }

.g3d-modal {
  --g3d-navy: #1a44b0;
  --g3d-green: #22D3A6;
  --g3d-green-dark: #18A87B;
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-align: left;
}
.g3d-modal[hidden] { display: none; }
.g3d-modal *, .g3d-modal *::before, .g3d-modal *::after { box-sizing: border-box; }

.g3d-backdrop {
  position: absolute; inset: 0;
  background: rgba(6,1,68,.55);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  opacity: 0; transition: opacity .25s ease;
}
.g3d-dialog {
  position: relative; width: 100%; max-width: 420px;
  max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem);
  overflow-y: auto; overscroll-behavior: contain; border-radius: 1.25rem;
  opacity: 0; transform: translateY(14px) scale(.98);
  transition: opacity .25s ease, transform .25s ease;
  outline: none;
}
.g3d-modal.is-open .g3d-backdrop { opacity: 1; }
.g3d-modal.is-open .g3d-dialog { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .g3d-backdrop, .g3d-dialog { transition: none; }
}

.g3d-card {
  position: relative; background: #fff; border-radius: 1.25rem;
  padding: 0 1.6rem 1.4rem; text-align: center; color: #18181b;
  box-shadow: 0 30px 80px -10px rgba(0,0,0,.55);
}
/* Royal-blue logo band across the top of the card */
.g3d-band {
  margin: 0 -1.6rem 1.1rem; padding: .9rem 1rem .8rem;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 2px, transparent 2px 5px),
    var(--g3d-navy);
  border-radius: 1.25rem 1.25rem 0 0;
}
.g3d-modal .g3d-logo { display: block; width: 104px; max-width: 104px; height: auto; margin: 0 auto; }

.g3d-modal .g3d-close {
  position: absolute; top: .7rem; right: .7rem; z-index: 2;
  width: 34px; height: 34px; padding: 0; margin: 0; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: rgba(255,255,255,.8); box-shadow: none;
  transition: background .15s, color .15s;
}
.g3d-modal .g3d-close:hover { background: rgba(255,255,255,.12); color: #fff; }
.g3d-modal .g3d-close svg { width: 18px; height: 18px; }

.g3d-modal .g3d-title {
  margin: 0 0 .5rem; padding: 0; font-family: inherit; text-transform: none; letter-spacing: 0;
  font-size: 1.3rem; font-weight: 800; color: #18181b; line-height: 1.25;
}
.g3d-modal .g3d-sub { margin: 0 0 1.25rem; padding: 0; font-size: .9rem; color: #3f3f46; line-height: 1.5; }
.g3d-modal .g3d-form { margin: 0; text-align: left; }

.g3d-modal .g3d-field { margin: 0 0 .9rem; }
.g3d-modal .g3d-field label {
  display: block; margin: 0 0 .3rem; padding: 0;
  font-size: .8rem; font-weight: 700; color: #18181b; text-transform: none; letter-spacing: 0; line-height: 1.3;
}
.g3d-modal .g3d-req { color: #d1345b; }
.g3d-input-wrap { position: relative; }
.g3d-input-wrap > svg {
  position: absolute; left: .8rem; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: #8b93a7; pointer-events: none;
}
.g3d-modal .g3d-field input {
  display: block; width: 100%; height: auto; margin: 0;
  padding: .75rem 1rem .75rem 2.45rem;
  background: #f8f8fb; border: 1.5px solid #e4e4ea; border-radius: .6rem; box-shadow: none;
  font-family: inherit; font-size: .9rem; line-height: 1.3; color: #18181b;
  outline: none; transition: border-color .15s, background .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.g3d-modal .g3d-field input::placeholder { color: #9ca3af; opacity: 1; }
.g3d-modal .g3d-field input:focus {
  border-color: var(--g3d-green-dark); background: #fff; box-shadow: 0 0 0 3px rgba(34,211,166,.18);
}
.g3d-field--error input { border-color: #d1345b !important; background: #fff5f7 !important; }
.g3d-field__error-msg { display: block; color: #d1345b; font-size: .72rem; font-weight: 600; margin-top: .35rem; }

.g3d-modal .g3d-error {
  margin: 0 0 .75rem; padding: .6rem .8rem; border-radius: .5rem;
  background: #fff5f7; border: 1px solid #f3c2cf; color: #b42346; font-size: .8rem; font-weight: 600;
}
.g3d-modal .g3d-error[hidden] { display: none; }

.g3d-modal .g3d-submit {
  display: block; width: 100%; margin: .4rem 0 0; padding: .95rem 1rem;
  border: none; border-radius: .6rem; cursor: pointer;
  background: linear-gradient(180deg, #22b573 0%, #18995f 100%); color: #fff;
  font-family: inherit; font-size: .95rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; line-height: 1.2;
  box-shadow: 0 10px 22px -10px rgba(24,153,95,.8);
  transition: transform .2s, filter .2s;
}
.g3d-modal .g3d-submit:hover { transform: translateY(-1px); filter: brightness(1.06); }
.g3d-modal .g3d-submit:disabled { opacity: .75; cursor: default; transform: none; }
.g3d-modal .g3d-note { margin: .7rem 0 0; padding: 0; font-size: .74rem; color: #52525b; text-align: center; line-height: 1.4; }

/* ── Address autocomplete dropdown (Google Places) ── */
.g3d-ac__panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5;
  background: #fff; border: 1px solid #e4e4ea; border-radius: .6rem;
  box-shadow: 0 14px 30px -10px rgba(0,0,0,.3); overflow: hidden;
}
.g3d-ac__panel[hidden] { display: none; }
.g3d-modal .g3d-ac__list { list-style: none; margin: 0; padding: .25rem 0; }
.g3d-modal .g3d-ac__item {
  display: flex; flex-direction: column; gap: .1rem; margin: 0;
  padding: .55rem .85rem .55rem 2.2rem; cursor: pointer; position: relative;
  font-size: .85rem; color: #18181b; line-height: 1.3;
}
.g3d-ac__item::before {
  content: ""; position: absolute; left: .8rem; top: .7rem; width: 14px; height: 14px;
  background: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2318A87B'%3e%3cpath d='M12 2a7 7 0 0 0-7 7c0 5 7 13 7 13s7-8 7-13a7 7 0 0 0-7-7Zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5Z'/%3e%3c/svg%3e") no-repeat center / contain;
}
.g3d-ac__item strong { font-weight: 600; }
.g3d-ac__item span { font-size: .75rem; color: #6b7280; }
.g3d-ac__item:hover, .g3d-ac__item.is-active { background: #f0fbf7; }
.g3d-ac__attr {
  padding: .3rem .75rem .4rem; text-align: right;
  font-size: .68rem; color: #6b7280; border-top: 1px solid #f1f1f5;
}

@media (max-width: 480px) {
  .g3d-modal { padding: .6rem; }
  .g3d-dialog { max-height: calc(100vh - 1.2rem); max-height: calc(100dvh - 1.2rem); }
  .g3d-card { padding: 0 1rem 1.2rem; }
  .g3d-band { margin: 0 -1rem 1rem; }
}
