/* =========================
   ZIP Gate + Form Container
   ADDRESS Gate (leaf removal pages use addressgate-* classes, same styles)
   ========================= */
.form-shell.zipgate-box,
.form-shell.addressgate-box{
  /* knobs */
  --zg-gate-w: 560px;          /* ZIP step width incl. border */
  --zg-form-w: 980px;          /* Jotform step width */
  --zg-gate-min-h: 150px;
  --zg-form-min-h: 680px;
  --zg-input-basis: 260px;     /* input starting width */
  --zg-input-grow: 2;          /* input flex share */
  --zg-btn-grow: 1;            /* button flex share */
  --btn-pad-x: 32px;           /* symmetric button padding */

  background: var(--cream);
  border: 12px solid #0e0e0e;
  border-radius: 30px;
  padding: 0px;
  overflow: hidden;

  box-sizing: border-box;
  width: min(100%, var(--zg-gate-w));
  margin-inline: auto;
  transition: width 300ms ease;

  /* Address gate also uses these same vars (--zg- works for both, --ag- is alias) */
  --ag-h: var(--zg-h, auto);
  --ag-form-min-h: var(--zg-form-min-h);

  font-family: inherit !important;
  color: #0e0e0e;
}

/* Force site font/size on controls */
.form-shell.zipgate-box input,
.form-shell.zipgate-box select,
.form-shell.zipgate-box textarea,
.form-shell.zipgate-box button:not(.zipgate-back),
.form-shell.addressgate-box input,
.form-shell.addressgate-box select,
.form-shell.addressgate-box textarea,
.form-shell.addressgate-box button:not(.addressgate-back){
  font-family: inherit !important;
  font-size: 21px !important;
  line-height: 1 !important;
}

/* Weights to match site buttons */
.zipgate-input,
.addressgate-input{ font-weight: 700 !important; color:#0e0e0e !important; }
.zipgate-btn{ font-weight: 700 !important; }

/* Placeholder: site font, #999 */
.form-shell.zipgate-box input::placeholder,
.form-shell.addressgate-box input::placeholder{ font-family: inherit !important; font-size: inherit !important; font-weight:600 !important; color:#999 !important; opacity:1 !important; }
.form-shell.zipgate-box input::-webkit-input-placeholder,
.form-shell.addressgate-box input::-webkit-input-placeholder{ font-family: inherit !important; font-size: inherit !important; font-weight:600 !important; color:#999 !important; opacity:1 !important; }
.form-shell.zipgate-box input::-moz-placeholder,
.form-shell.addressgate-box input::-moz-placeholder{ font-family: inherit !important; font-size: inherit !important; font-weight:600 !important; color:#999 !important; opacity:1 !important; }
.form-shell.zipgate-box input:-ms-input-placeholder,
.form-shell.addressgate-box input:-ms-input-placeholder{ font-family: inherit !important; font-size: inherit !important; font-weight:600 !important; color:#999 !important; opacity:1 !important; }
.form-shell.zipgate-box input::-ms-input-placeholder,
.form-shell.addressgate-box input::-ms-input-placeholder{ font-family: inherit !important; font-size: inherit !important; font-weight:600 !important; color:#999 !important; opacity:1 !important; }

/* Widen on pass */
.passed .form-shell.zipgate-box,
.passed .form-shell.addressgate-box{ width: min(100%, var(--zg-form-w)); }

/* Mobile wrapper full-width */
@media (max-width: 680px){
  .form-shell.zipgate-box,
  .form-shell.addressgate-box{ width: 100%; }
}

/* ===== Height management ===== */
.zipgate-stack,
.addressgate-stack{
  position: relative;
  height: var(--zg-h, auto);
  min-height: var(--zg-gate-min-h);
  transition: height 350ms ease, min-height 350ms ease;
}
.passed .zipgate-stack,
.passed .addressgate-stack{ min-height: var(--zg-form-min-h); }

/* Panels */
.zipgate-card,
.zipgate-iframe,
.addressgate-card,
.addressgate-iframe{ position: absolute; inset: 0; }

/* Gate card */
.zipgate-card,
.addressgate-card{
  border-radius: 10px;
  padding: 32px;  /* 16px card + 16px parent padding (now removed from parent) */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: transform 400ms ease, opacity 400ms ease;
  z-index: 2;
}
/* Jotform iframe has no padding (only zipgate-card gets padding) */
.zipgate-iframe,
.addressgate-iframe{
  padding: 0;
}

/* Row */
.zipgate-row,
.addressgate-row{
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: nowrap;
  width: 100%;
}

/* Input */
.zipgate-input,
.addressgate-input{
  flex: var(--zg-input-grow) 1 var(--zg-input-basis);
  min-width: 180px;
  max-width: none;
  padding: 16px 18px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-sizing: border-box;
  min-height: 0px;            /* match button height */
}

/* Button */
.zipgate-btn,
.zipgate-back,
.addressgate-back{
  display: flex;
  align-items: center;
  justify-content: center;     /* hard center */
  text-align: center;
  white-space: nowrap;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  box-sizing: border-box;
  min-height: 0px;            /* match input height */
}
.zipgate-btn{
  background: #014421;
  color: #fff;
  flex: var(--zg-btn-grow) 1 160px;
  min-width: clamp(200px, 35%, 360px);
  padding-block: 16px;               /* keep vertical sizing consistent */
  padding-inline: var(--btn-pad-x);   /* symmetric padding */
  appearance: none;                   /* iOS centering consistency */
  -webkit-appearance: none;
  min-height: 56px;                   /* matches input height on narrow screens */
}
.zipgate-back,
.addressgate-back{
  background: transparent;
  color: #ddd;
  border: none;
  padding: 15px 25px;
  min-width: 0;
  font-size: 16px !important;
  font-weight: 500;
  cursor: pointer;
}
.zipgate-back:focus,
.addressgate-back:focus{
  outline: 2px solid #ccc;
  outline-offset: 2px;
}

#form-wrap.has-result #zip-back-btn,
#form-wrap.has-result #address-back-btn{
  display: none;                      /* Hides Change Zip/Address button after submitting photo form */
}

.zipgate-result [hidden]{
  display: none !important;
}

/* Desktop: larger horizontal padding for Change ZIP button */
@media (min-width: 681px){
  .zipgate-back{
    padding: 15px 40px;
  }
}

/* Mobile stack */
@media (max-width: 680px){
  .zipgate-row{
    flex-wrap: wrap;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .zipgate-input,
  .zipgate-btn{
    width: 100%;
    flex: none;
    min-width: 0;
  }
  .zipgate-input{
    text-align: center;
  }
  .zipgate-input::placeholder,
  .zipgate-input::-webkit-input-placeholder,
  .zipgate-input::-moz-placeholder,
  .zipgate-input:-ms-input-placeholder,
  .zipgate-input::-ms-input-placeholder{
    text-align: center;
  }
}

/* Messages */
.zipgate-msg,
.address-msg{ min-height:22px; margin-top:8px; font-size:14px; color:#6b7280; }
.zipgate-msg.ok,
.address-msg.ok{ color:#065f46; }
.zipgate-msg.err,
.address-msg.err{ color:#7f1d1d; }
.zipgate-msg.warn,
.address-msg.warn{ color:#92400e; }
.zipgate-msg.info,
.address-msg.info{ color:#1e40af; }
.zipgate-hint,
.addressgate-hint{ color:#6b7280; font-size:14px; margin:6px 0 0 0; }

/* Form pane */
.zipgate-iframe{ z-index:1; overflow:hidden; }
.zipgate-iframe iframe{
  position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; border: 0;
}
.zipgate-iframe.has-result iframe{ opacity:0; pointer-events:none; }

/* Result overlay */
.zipgate-result{
  position:absolute; inset:0; display:none; z-index:2;
  padding:32px 24px; background:var(--cream); border-radius:12px;
  align-items:center; justify-content:center; text-align:center; color:#0f172a;
}
.zipgate-iframe.has-result .zipgate-result{ display:flex; }
.zipgate-result__box{ max-width:420px; margin:0 auto; display:flex; flex-direction:column; gap:12px; }
.zipgate-result__eyebrow{ margin:0; font-size:16px; letter-spacing:.08em; text-transform:uppercase; color:#6b7280; }
.zipgate-result__price{
  margin:0;
  font-size:clamp(36px,5vw,52px);
  font-weight:800;
  color:#014421;
  display:inline-flex;
  gap:0;
  justify-content:center;
  min-height:clamp(36px,5vw,52px);
}
.zipgate-progress{
  margin:12px auto 18px 12px;
  padding:2px 0 0;
  max-width:360px;
  width:100%;
}
.zipgate-progress__header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:10px;
  font-size:0.75rem;
  text-transform:uppercase;
  letter-spacing:0.08em;
  color:#4b5563;
  font-weight:700;
}
.zipgate-progress__percent{
  font-size:0.9rem;
  color:var(--green);
}
.zipgate-progress__track{
  position:relative;
  height:22px;
  border-radius:999px;
  background:rgba(1,68,33,0.12);
  border:1px solid rgba(1,68,33,0.35);
  overflow:hidden;
}
.zipgate-progress__track::after{
  content:'';
  position:absolute;
  inset:0;
  background:rgba(255,255,255,0.3);
  pointer-events:none;
}
.zipgate-progress__fill{
  position:absolute;
  inset:0;
  width:var(--progress-fill,0%);
  background:var(--green);
  border-radius:inherit;
  transition:width 450ms ease-in-out;
  box-shadow:0 4px 10px rgba(1,68,33,0.25);
}
.zipgate-progress__status{
  margin-top:12px;
  font-size:1rem;
  font-weight:700;
  color:#1f2937;
  opacity:0;
  transform:translateY(6px);
  transition:opacity 200ms ease, transform 200ms ease;
}
.zipgate-progress__status.is-visible{
  opacity:1;
  transform:translateY(0);
}
.zipgate-result__price .price-char{
  display:inline-block;
  opacity:0;
  transform:translateY(0.45em);
  animation: priceChar 480ms cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
}
.zipgate-result__note{
  margin:0;
  font-size:16px;
  color:#374151;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  flex-wrap:wrap;
  text-align:center;
}
.zipgate-result__note #estimate-note-text{
  display:block;
  line-height:1.35;
}
.zipgate-result__note--large-lot{
  background:var(--green);
  border:2px solid #013319;
  border-radius:var(--R);
  padding:20px 24px;
  color:var(--cream);
}
.zipgate-result__ready{
  margin:0;
  font-size:17px;
  color:#059669;
  line-height:1.4;
  text-align:center;
}
.zipgate-result__qualification{
  margin:0;
  font-size:14px;
  color:#6b7280;
  line-height:1.5;
  text-align:left;
  max-width:360px;
  margin-left:auto;
  margin-right:auto;
}
.note-tooltip{
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:0.9rem;
  color:#014421;
  font-weight:700;
  cursor:pointer;
  text-decoration:none;
  outline:0;
}
.note-tooltip:focus-visible{
  outline:2px solid rgba(1,68,33,0.6);
  outline-offset:3px;
}
.note-tooltip::after{
  content:'?';
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  border-radius:999px;
  background:#014421;
  color:#fff;
  font-size:0.7rem;
  line-height:1;
  padding-bottom:1px;
}
.note-tooltip__panel{
  position:absolute;
  z-index:5;
  top:calc(100% + 10px);
  left:50%;
  transform:translate(-50%, -6px);
  width:min(320px, 80vw);
  background:#fff;
  color:#111827;
  border:1px solid rgba(15,23,42,0.12);
  border-radius:12px;
  box-shadow:0 18px 35px rgba(15,23,42,0.18);
  padding:16px 18px;
  opacity:0;
  pointer-events:none;
  transition:opacity 0.18s ease, transform 0.18s ease;
}
.note-tooltip:focus-within .note-tooltip__panel,
.note-tooltip:hover .note-tooltip__panel{
  opacity:1;
  pointer-events:auto;
  transform:translate(-50%, 0);
}
.note-tooltip__list{
  margin:0;
  padding:0;
  list-style:none;
  display:flex;
  flex-direction:column;
  gap:8px;
  font-size:0.9rem;
  line-height:1.4;
  text-align:left;
}
.zipgate-result__list{
  list-style:none;
  padding:0;
  margin:12px auto 18px;
  display:flex;
  flex-direction:column;
  gap:8px;
  text-align:left;
  max-width:360px;
}
.zipgate-result__list li{
  position:relative;
  padding-left:32px;
  font-size:16px;
  color:#1f2937;
  line-height:1.35;
}
.zipgate-result__list li::before{
  content:'';
  position:absolute;
  left:0;
  top:0.2em;
  width:18px;
  height:18px;
  background:url('/assets/img/tough-oak-check-in-green-circle.png') center/contain no-repeat;
}
/* Show checkmarks only on benefits list */
.zipgate-result__list:not(.zipgate-result__list--checkmarks) li::before{
  background:none;
  content:'•';
  font-size:1.5em;
  line-height:1;
  color:#10b981;
}
.zipgate-result .btn--stacked{
  gap:2px;
  padding-top:12px;
  padding-bottom:12px;
}
.zipgate-result .btn__eyebrow{
  font-size:0.65rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  opacity:0.5;
}
.zipgate-result .btn__title{
  font-size:1.05rem;
  text-transform:none;
}
.zipgate-result .btn__eyebrow,
.zipgate-result .btn__title{
  display:block;
  text-align:center;
  line-height:1.15;
}

@keyframes priceChar{
  to{
    opacity:1;
    transform:translateY(0);
  }
}

/* Anim + toolbar */
.passed .zipgate-card,
.passed .addressgate-card{ transform: translateX(-110%); opacity: 0; }
.zipgate-toolbar,
.addressgate-toolbar{ position:absolute; top:2px; right:2px; z-index:3; display:flex; gap:8px; }
.zipgate-back:hover,
.addressgate-back:hover{ color:#222; text-decoration: none; }

.addressgate-toolbar{
  position:static;
  justify-content:flex-end;
  padding:8px 8px 0;
  margin-bottom:12px;
}

/* =========================
   Google Place Autocomplete Element Styling
   ========================= */

/* Hide the magnifying glass icon for cleaner look */
gmp-place-autocomplete::part(icon) {
  display: none !important;
}

/* Style the Place Autocomplete input to match our design */
gmp-place-autocomplete {
  width: 100%;
  display: block;
}

gmp-place-autocomplete input {
  font-family: inherit !important;
  font-size: 21px !important;
  font-weight: 700 !important;
  color: #0e0e0e !important;
  padding: 16px 18px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: 0px !important;
}

gmp-place-autocomplete input::placeholder {
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: 600 !important;
  color: #999 !important;
  opacity: 1 !important;
}

/* =========================
   Leaf Estimator Card Stack
   ========================= */
.leaf-estimator{
  position:relative;
  background:var(--cream);
  border-radius:16px;
  padding:24px 20px 18px;
  color:#0e0e0e;
  display:flex;
  flex-direction:column;
  gap:16px;
  min-height:360px;
}
.leaf-estimator__header{margin-bottom:4px;}
.leaf-estimator__eyebrow{
  margin:0;
  font-size:.82rem;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:800;
  color:#6b7280;
}
.leaf-estimator__title{
  margin:4px 0;
  font-size:1.3rem;
  font-weight:800;
}
.leaf-estimator__subtext{
  margin:0;
  font-size:.95rem;
  color:#4b5563;
}
.leaf-estimator__step{
  margin:8px 0 0;
  font-size:.85rem;
  color:#6b7280;
}
.leaf-estimator__body{
  overflow:hidden;
  position:relative;
  flex:1 1 auto;
}
.leaf-estimator__track{
  display:flex;
  width:100%;
  transition:transform 320ms ease;
  transform:translateX(calc(-100% * var(--leaf-step,0)));
}
.leaf-card{
  flex:0 0 100%;
  padding:8px 2px 4px;
}
.leaf-card__content{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.leaf-estimator__footer{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:6px;
}
.leaf-nav-btn{flex:1 1 0;}
.leaf-pill-group{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.leaf-pill{
  border-radius:999px;
  border:1px solid #cbd5e1;
  background:#e2e8f0;
  padding:10px 18px;
  font-size:.95rem;
  font-weight:700;
  cursor:pointer;
  color:#0f172a;
  text-align:center;
  flex:1 1 calc(50% - 10px);
  min-width:140px;
  transition:background-color .2s ease, color .2s ease, border-color .2s ease, transform .1s ease;
}
.leaf-pill:active{ transform:scale(0.98); }
.leaf-pill[aria-pressed="true"],
.leaf-pill.is-active{
  background:#014421;
  border-color:#014421;
  color:#fff;
}
.leaf-pill-group{ width:100%; }
@media (max-width:520px){
  .leaf-pill{ flex:1 1 100%; }
}
.leaf-field{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.leaf-label{font-size:.9rem;font-weight:600;}
.leaf-help{
  font-size:.85rem;
  color:#6b7280;
  margin:0;
}
.leaf-input,
.leaf-textarea{
  font:inherit;
  border-radius:12px;
  border:1px solid #cbd5e1;
  padding:10px 12px;
  width:100%;
  box-sizing:border-box;
}
.leaf-textarea{resize:vertical;}
.leaf-error{
  margin:4px 0 0;
  min-height:18px;
  font-size:.82rem;
  color:#b91c1c;
}
.leaf-area-photos{
  border-radius:14px;
  border:1px solid #e5e7eb;
  padding:12px 12px 10px;
  background:#f9fafb;
}
.leaf-area-title{
  margin:0 0 4px;
  font-size:1rem;
  font-weight:700;
}
.leaf-area-help{
  margin:0 0 8px;
  font-size:.87rem;
  color:#4b5563;
}
.leaf-upload{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.leaf-upload__drop{
  border-radius:12px;
  border:1px dashed #9ca3af;
  padding:12px;
  text-align:center;
  background:rgba(255,255,255,0.8);
  cursor:pointer;
}
.leaf-upload__or{
  margin:4px 0;
  font-size:.8rem;
  color:#6b7280;
}
.leaf-upload__button{
  display:inline-block;
  border-radius:999px;
  background:#014421;
  color:#fff;
  padding:6px 16px;
  font-size:.9rem;
  font-weight:700;
  cursor:pointer;
}
.leaf-upload__hint{
  margin:6px 0 0;
  font-size:.8rem;
  color:#6b7280;
}
.leaf-upload__thumbs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.leaf-thumb{
  position:relative;
  width:70px;
  height:70px;
  border-radius:10px;
  overflow:hidden;
  border:1px solid #e5e7eb;
  background:#f3f4f6;
}
.leaf-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.leaf-thumb__remove{
  position:absolute;
  top:2px;
  right:2px;
  border:none;
  background:rgba(0,0,0,0.6);
  color:#fff;
  border-radius:999px;
  width:18px;
  height:18px;
  font-size:.7rem;
  cursor:pointer;
}
.leaf-consent__label{
  display:flex;
  align-items:flex-start;
  gap:8px;
  font-size:.9rem;
}
.leaf-consent__label input[type="checkbox"]{margin-top:3px;}
@media (max-width:680px){
  .leaf-estimator{padding-inline:12px;}
  .leaf-pill{
    font-size:.88rem;
    padding-inline:10px;
  }
}

/* =========================
   Schedule Page (standalone booking)
   ========================= */
.schedule-page{
  padding: 60px 0 40px;
  min-height: 60vh;
}
.schedule-page .container{
  max-width: 800px;
}
.schedule-page .form-shell.schedule-box{
  width: min(100%, 680px);
}
.schedule-page .section-band{
  margin-bottom: 24px;
}
@media (max-width: 680px){
  .schedule-page{
    padding: 40px 0 30px;
  }
}
