/* HPT V3 Track B — public mobile chrome (forms + header + footer)
   Load LAST. Wins over admin hpt-public-nav.css row layout. */

.hpt-topbar { position: sticky; top: 0; z-index: 900; }
.hpt-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 1.5rem 2rem;
  align-items: start;
}
.hpt-footer h4 {
  margin: 0 0 .55rem;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
}
.hpt-footer nav { display: flex; flex-direction: column; gap: .4rem; }
.hpt-footer nav a { color: #cbd5e1; text-decoration: none; font-size: .92rem; }
.hpt-footer-brand { font-weight: 700; color: #fff; margin-bottom: .4rem; font-size: 1rem; }
.hpt-footer-copy { max-width: 1120px; margin: 1.25rem auto 0; font-size: .78rem; color: #64748b; }
.hpt-nl-form,
#newsletter-form {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  align-items: stretch;
}
#newsletter-form input[type=email] {
  flex: 1 1 160px;
  min-width: 0;
  padding: .65rem .75rem;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #0b1220;
  color: #e2e8f0;
  font-size: 16px;
}
#newsletter-form button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  padding: .65rem 1rem;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  min-height: 44px;
}

/* Form pages: no leftover desert under footer */
html.hpt-form-page,
body.hpt-form-page {
  min-height: 0 !important;
  height: auto !important;
  padding-bottom: 0 !important;
  background: #f4f1ea !important;
}
html[data-theme=dark].hpt-form-page,
html[data-theme=dark] body.hpt-form-page {
  background: #0b1220 !important;
}
.hpt-form-page .hpt-auth-wrap {
  max-width: 32rem;
  margin: 1rem auto 1.15rem !important;
  padding: 0 1rem .25rem !important;
}
.hpt-form-page .hpt-footer { margin-top: 1rem; }

@media (max-width: 760px) {
  .hpt-topbar-inner {
    display: grid !important;
    grid-template-columns: 40px minmax(0, 1fr) auto !important;
    grid-template-areas:
      "menu brand actions"
      "modes modes modes" !important;
    align-items: center !important;
    gap: .4rem .55rem !important;
    padding: .55rem .85rem .5rem !important;
    flex-wrap: unset !important;
  }
  .hpt-menu-toggle {
    grid-area: menu;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
  }
  .hpt-brand {
    grid-area: brand;
    font-size: .92rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .hpt-top-actions {
    grid-area: actions;
    margin-left: 0 !important;
  }
  .hpt-mode-switch {
    grid-area: modes;
    width: 100% !important;
    order: unset !important;
    display: flex !important;
  }
  .hpt-mode-switch a {
    flex: 1 1 0;
    text-align: center;
    padding: .42rem .4rem !important;
  }

  /* Kill desktop clipped row — drawer only */
  .hpt-nav-secondary,
  nav.hpt-nav-secondary {
    display: none !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 100% !important;
    background: #0b1220 !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    padding: .35rem 0 .85rem !important;
    max-height: min(78dvh, 640px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 16px 32px rgba(0,0,0,.35);
    z-index: 960;
  }
  .hpt-nav-secondary.is-open,
  nav.hpt-nav-secondary.is-open {
    display: flex !important;
  }
  .hpt-nav-secondary a,
  .hpt-nav-parent,
  .hpt-nav-parent > a {
    display: block !important;
    width: 100%;
    color: #e2e8f0 !important;
    font-size: 1rem !important;
    padding: .72rem 1rem !important;
    border-bottom: 1px solid rgba(255,255,255,.06);
    white-space: normal !important;
  }
  .hpt-nav-parent { padding: 0 !important; border: 0 !important; }
  .hpt-nav-sub {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 0 .25rem !important;
    background: rgba(255,255,255,.03);
  }
  .hpt-nav-sub a {
    padding: .55rem 1rem .55rem 1.65rem !important;
    font-size: .92rem !important;
    color: #94a3b8 !important;
    border-bottom: 0 !important;
  }

  .hpt-footer {
    padding: 1.25rem 1rem calc(1.1rem + env(safe-area-inset-bottom, 0px)) !important;
    margin-top: 1.1rem !important;
  }
  .hpt-footer-inner {
    grid-template-columns: 1fr !important;
    gap: 1.15rem !important;
  }
  .hpt-nl-form,
  #newsletter-form {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  #newsletter-form input[type=email],
  #newsletter-form button {
    width: 100% !important;
    flex: none !important;
  }
}

/* Form fields — phone first */
.hpt-auth-wrap .card {
  width: 100%;
  max-width: 100%;
}
.hpt-auth-wrap input,
.hpt-auth-wrap textarea,
.hpt-auth-wrap select {
  width: 100% !important;
  max-width: 100%;
  font-size: 16px !important;
  min-height: 44px;
  box-sizing: border-box;
}
.hpt-auth-wrap textarea { min-height: 120px; }
.hpt-auth-wrap .btn,
.hpt-auth-wrap button.btn {
  width: 100% !important;
  min-height: 48px !important;
  font-size: 1rem;
}

@media (min-width: 761px) {
  .hpt-menu-toggle { display: none !important; }
}
