/* =====================================================================
   Help Center - page-specific styles (scope: .hp-page)
   ---------------------------------------------------------------------
   Design system: tokens via var(--o-*) from base-tokens.css (loaded
   globally in master.blade.php). Fonts via order-shared.css @import
   (loaded BEFORE this file by every help blade, per the account-center
   shared-layer convention). Zero Bootstrap. Native mobile app experience
   (single column, sticky pill nav, >=44px taps, safe-area).

   Layout mirrors the account-center two-column baseline
   (DESIGN_SPEC §7.6–§7.9 / account-message.css / order-shared.css):
     .hp-page > .hp-layout(flex) > .hp-sidebar(sticky) + .hp-main
   Container geometry follows the global red lines:
     - box-sizing: content-box
     - padding: 36px 10px 48px (mobile 14px)
     - three-tier max-width 1180 / 1280 / 1380 (no 992–1200 tier)
     - NO width:100%
   ===================================================================== */

/* ---------- page root ---------- */
.hp-page {
  font-family: var(--o-font-body);
  color: var(--o-ink);
  background: var(--o-bg);            /* red line ②: explicit page bg */
  min-height: 70vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

/* a11y focus visibility */
.hp-page a:focus-visible,
.hp-page button:focus-visible,
.hp-page input:focus-visible,
.hp-page textarea:focus-visible {
  outline: 2px solid var(--o-accent);
  outline-offset: 2px;
}

/* ---------- layout (two-column, sticky sidebar) ---------- */
.hp-page .hp-layout {
  box-sizing: content-box;            /* red line ③ */
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 10px 48px;
  display: flex;
  align-items: flex-start;
  gap: 28px;
}
@media (min-width: 1300px) { .hp-page .hp-layout { max-width: 1280px; } }
@media (min-width: 1400px) { .hp-page .hp-layout { max-width: 1380px; } }

.hp-page .hp-sidebar {
  flex: 0 0 220px;
  align-self: flex-start;
  position: sticky;
  top: calc(var(--o-header-h, 50px) + env(safe-area-inset-top) + 14px);
}
.hp-page .hp-main { flex: 1 1 auto; min-width: 0; }

/* ---------- sidebar nav ---------- */
.hp-page .hp-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--o-card);
  border-radius: var(--o-radius);
  box-shadow: var(--o-shadow);
  padding: 10px;
}
.hp-page .hp-nav-title {
  font: 700 15px/1.2 var(--o-font-display);
  color: var(--o-ink);
  letter-spacing: .01em;
  padding: 8px 12px 10px;
}
.hp-page .hp-nav-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: var(--o-radius-sm);
  color: var(--o-ink-2);
  font: 600 14px/1.3 var(--o-font-body);
  text-decoration: none;
  transition: background-color .18s ease, color .18s ease;
}
.hp-page .hp-nav-link:hover {
  background: var(--o-accent-soft);
  color: var(--o-accent);
}
.hp-page .hp-nav-link.is-active {
  background: var(--o-accent);
  color: #fff;
}

/* ---------- content card ---------- */
.hp-page .hp-card {
  background: var(--o-card);
  border-radius: var(--o-radius);
  box-shadow: var(--o-shadow);
  overflow: hidden;
  padding: 28px 32px;
  animation: hpCardIn .45s cubic-bezier(.22, .61, .36, 1) both;
}
@keyframes hpCardIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.hp-page .hp-card__head {
  padding-bottom: 16px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--o-line-soft);
}
.hp-page .hp-card__title {
  margin: 0;
  font: 800 26px/1.2 var(--o-font-display);
  color: var(--o-ink);
  letter-spacing: -.02em;
}

/* ---------- prose (typography for legal / info text) ---------- */
.hp-page .hp-prose { color: var(--o-ink-2); }
.hp-page .hp-h {
  font: 700 17px/1.4 var(--o-font-display);
  color: var(--o-ink);
  letter-spacing: -.01em;
  margin: 24px 0 12px;
  padding-left: 12px;
  border-left: 3px solid var(--o-accent);
}
.hp-page .hp-prose > .hp-h:first-child { margin-top: 0; }
.hp-page .hp-h--sub {
  font-size: 15px;
  border-left-color: var(--o-line);
  margin: 16px 0 8px;
}
.hp-page .hp-p {
  font: 400 14.5px/1.75 var(--o-font-body);
  color: var(--o-ink-2);
  margin: 0 0 14px;
}
.hp-page .hp-p--lead {
  font-size: 15px;
  font-weight: 500;
  color: var(--o-ink);
  margin-bottom: 16px;
}
.hp-page .hp-p--deep { padding-left: 18px; }
.hp-page .hp-p--mb-lg { margin-bottom: 22px; }
.hp-page .hp-p--mb-0 { margin-bottom: 0; }
.hp-page .hp-prose a {
  color: var(--o-accent);
  text-decoration: none;
  border-bottom: 1px solid var(--o-accent-soft);
  font-weight: 500;
  transition: border-color .18s ease;
}
.hp-page .hp-prose a:hover { border-bottom-color: var(--o-accent); }

/* ---------- contact (contactus page) ---------- */
.hp-page .hp-contact {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 28px;
}
.hp-page .hp-info-item { margin-bottom: 20px; }
.hp-page .hp-info-item:last-child { margin-bottom: 0; }
.hp-page .hp-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--o-accent-soft);
  color: var(--o-accent);
  margin-bottom: 10px;
}
.hp-page .hp-info-head {
  margin: 0 0 6px;
  font: 700 15px/1.2 var(--o-font-display);
  color: var(--o-ink);
}
.hp-page .hp-info-text {
  margin: 0;
  font: 400 14px/1.6 var(--o-font-body);
  color: var(--o-ink-2);
}
.hp-page .hp-info-text a { color: var(--o-accent); text-decoration: none; }
.hp-page .hp-info-text a:hover { text-decoration: underline; }

.hp-page .hp-form { display: flex; flex-direction: column; gap: 14px; }
.hp-page .hp-field { display: flex; flex-direction: column; gap: 6px; }
.hp-page .hp-field > label {
  font: 600 13px var(--o-font-body);
  color: var(--o-ink-2);
}
.hp-page .hp-input,
.hp-page .hp-textarea {
  width: 100%;
  border: 1px solid var(--o-line);
  border-radius: var(--o-radius-sm);
  background: var(--o-card);
  color: var(--o-ink);
  font: 400 14px var(--o-font-body);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.hp-page .hp-input { height: 44px; padding: 0 12px; }
.hp-page .hp-textarea { min-height: 130px; padding: 12px; resize: vertical; line-height: 1.6; }
.hp-page .hp-input:focus,
.hp-page .hp-textarea:focus {
  outline: none;
  border-color: var(--o-accent);
  box-shadow: 0 0 0 3px var(--o-accent-soft);
}
.hp-page .hp-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
/* submit button keeps .feedback-submitBtn hook for the legacy JS handler */
.hp-page .hp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 26px;
  border-radius: var(--o-radius-sm);
  font: 600 14px/1 var(--o-font-display);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .12s ease;
}
.hp-page .hp-btn:active { transform: scale(.97); }
.hp-page .hp-btn--primary {
  background: var(--o-accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(1, 103, 243, .22);
}
.hp-page .hp-btn--primary:hover { background: var(--o-accent-ink); }

/* ---------- mobile (<=991px) native app experience ---------- */
@media (max-width: 991px) {
  .hp-page {
    /* clear the global bottom tab nav only; the fixed submit action bar
       reserves its own space via .hp-form-actions margin-bottom below */
    padding-bottom: calc(var(--o-bottomnav-h, 58px) + 20px);
    /* lift the whole page into its own stacking context (z above the global
       footer, which is position:relative;z-index:auto and paints after this
       subtree). This guarantees the fixed submit bar (z:50) stays above the
       footer when scrolled to bottom — pure styling, no layout/function change. */
    position: relative;
    z-index: 5;
  }
  .hp-page .hp-layout {
    flex-direction: column;
    align-items: stretch;          /* override desktop flex-start; cross-axis = horizontal in col */
    gap: 0;
    padding: 14px 14px calc(20px + env(safe-area-inset-bottom));
  }
  /* sticky, swipeable pill nav - mirrors account-message status bar */
  .hp-page .hp-sidebar {
    position: sticky;
    top: 0;
    flex: 0 0 auto;
    width: 100%;
    z-index: 40;
    margin-bottom: 14px;
    background: var(--o-bg);
    box-shadow: 0 6px 12px -8px rgba(13, 17, 23, .18);
  }
  .hp-page .hp-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding: 6px;
    background: var(--o-bg);
    box-shadow: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .hp-page .hp-nav::-webkit-scrollbar { display: none; }
  .hp-page .hp-nav-title { display: none; }
  .hp-page .hp-nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
    scroll-snap-align: start;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 999px;
    background: var(--o-card);
    border: 1px solid var(--o-line);
  }
  .hp-page .hp-nav-link.is-active {
    border-color: var(--o-accent);
  }
  .hp-page .hp-card {
    padding: 18px 16px 84px;        /* bottom space for the fixed action bar */
    border-radius: var(--o-radius-sm);
    overflow: visible;             /* let the fixed submit bar escape card clip on mobile */
  }
  .hp-page .hp-card__title { font-size: 22px; }
  .hp-page .hp-prose > .hp-h:first-child { margin-top: 2px; }

  /* contact stacks into one column */
  .hp-page .hp-contact { grid-template-columns: 1fr; gap: 22px; }

  /* submit -> fixed bottom action bar (spec §8.2 / §941; mirrors .ad-form-actions) */
  .hp-page .hp-form-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--o-bottomnav-h, 58px) + env(safe-area-inset-bottom));
    z-index: 50;
    margin: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--o-card);
    border-top: 1px solid var(--o-line);
    box-shadow: 0 -4px 16px rgba(13, 17, 23, .08);
    justify-content: stretch;
  }
  /* spacer reserves scroll space so the footer clears the fixed submit bar
     when scrolled to bottom (only rendered on contactus page via blade) */
  .hp-page .hp-action-spacer {
    display: block;
    height: calc(var(--o-bottomnav-h, 58px) + 76px);
  }
  .hp-page .hp-btn {
    flex: 1 1 auto;
    width: 100%;
    min-height: 46px;
  }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hp-page .hp-card { animation: none !important; transition: none !important; }
  .hp-page .hp-btn:active { transform: none; }
}
