/* togo-support.css
 * Cluster 25 — returns / contact / help-center / contextual help / survey-thanks
 * Tokens only. No raw hex outside fallbacks.
 */

/* ---- Category chip group (contact form) -------------------------- */
.togo-cat {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.togo-cat__chip {
  appearance: none;
  -webkit-appearance: none;
  background: var(--color-bg-elevated, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.12));
  color: var(--color-text-soft);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}
.togo-cat__chip:hover {
  border-color: var(--color-accent, rgba(255, 255, 255, 0.32));
  color: var(--color-text);
}
.togo-cat__chip:focus-visible {
  outline: 2px solid var(--color-accent, currentColor);
  outline-offset: 2px;
}
.togo-cat__chip[aria-pressed="true"] {
  background: var(--color-accent, rgba(255, 255, 255, 0.08));
  color: var(--color-accent-on, var(--color-text));
  border-color: transparent;
}

/* ---- Auto-suggest panel (contact form) --------------------------- */
.togo-suggest {
  margin-top: -4px;
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.10));
  background: var(--color-surface, rgba(255, 255, 255, 0.02));
  border-radius: 12px;
  padding: var(--space-3) var(--space-4);
  display: grid;
  gap: var(--space-2);
}
.togo-suggest[hidden] { display: none; }
.togo-suggest__title {
  margin: 0;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.togo-suggest__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.togo-suggest__item {
  margin: 0;
}
.togo-suggest__link {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-sm);
  line-height: 1.4;
  transition: background 120ms ease, color 120ms ease;
}
.togo-suggest__link:hover,
.togo-suggest__link:focus-visible {
  background: var(--color-bg-elevated, rgba(255, 255, 255, 0.04));
  color: var(--color-accent-text, var(--color-text));
  outline: none;
}
.togo-suggest__link strong {
  display: block;
  font-weight: 600;
  color: var(--color-text);
}
.togo-suggest__link span {
  display: block;
  margin-top: 2px;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

/* ---- Contextual help "?" trigger + drawer ------------------------ */
.togo-help-trigger {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.16));
  color: var(--color-text-soft);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-sans, system-ui, sans-serif);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-left: 4px;
  padding: 0;
  line-height: 1;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.togo-help-trigger:hover {
  background: var(--color-bg-elevated, rgba(255, 255, 255, 0.06));
  color: var(--color-text);
  border-color: var(--color-accent, rgba(255, 255, 255, 0.32));
}
.togo-help-trigger:focus-visible {
  outline: 2px solid var(--color-accent, currentColor);
  outline-offset: 2px;
}
.togo-help-trigger[aria-expanded="true"] {
  background: var(--color-accent, rgba(255, 255, 255, 0.08));
  color: var(--color-accent-on, var(--color-text));
  border-color: transparent;
}

/* Drawer / inline help bubble */
.togo-help-drawer {
  position: fixed;
  inset: auto clamp(12px, 3vw, var(--space-4)) calc(var(--tgp-mn-height, 64px) + env(safe-area-inset-bottom, 0px) + 14px) clamp(12px, 3vw, var(--space-4));
  max-width: 460px;
  margin: 0 auto;
  background: var(--color-bg-elevated, #0f0f0f);
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.12));
  border-radius: 16px;
  padding: var(--space-4) var(--space-5);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
  z-index: var(--z-popover, 500);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

body:has(.togo-help-drawer[data-open="true"]) #togo-feedback-fab,
body:has(.togo-help-drawer[data-open="true"]) .tgp-back-to-top {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(8px) !important;
}

@media (max-width: 767px) {
  body:has(.togo-help-drawer[data-open="true"]) .tgp-mobile-nav,
  body:has(.togo-help-drawer[data-open="true"]) .togo-bottom-nav {
    display: none !important;
  }
}
.togo-help-drawer[data-open="true"] {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.togo-help-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.togo-help-drawer__title {
  margin: 0;
  font-size: var(--text-md, 1rem);
  font-weight: 600;
  color: var(--color-text);
}
.togo-help-drawer__close {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--color-text-soft);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.togo-help-drawer__close:hover { color: var(--color-text); background: var(--color-surface, rgba(255, 255, 255, 0.04)); }
.togo-help-drawer__close:focus-visible { outline: 2px solid var(--color-accent, currentColor); outline-offset: 2px; }
.togo-help-drawer__body {
  font-size: var(--text-sm, 14px);
  line-height: 1.55;
  color: var(--color-text-soft);
}
.togo-help-drawer__body p { margin: 0 0 var(--space-3); }
.togo-help-drawer__body p:last-child { margin-bottom: 0; }
.togo-help-drawer__body a { color: var(--color-accent-text, currentColor); }

@media (min-width: 720px) {
  .togo-help-drawer {
    inset: auto calc(var(--space-5) + 72px) var(--space-5) auto;
    max-width: 380px;
    margin: 0;
  }
}

@media (max-width: 430px) {
  body[data-page="contact"] main,
  body[data-page="help"] main,
  body[data-page="bug-report"] main,
  body[data-page="feature-request"] main {
    padding-bottom: calc(var(--tgp-mn-height, 64px) + env(safe-area-inset-bottom, 0px) + var(--space-6));
  }

  body[data-page="help"] .fb-form,
  body[data-page="contact"] #support-form-el,
  body[data-page="bug-report"] #bug-report-form,
  body[data-page="feature-request"] #feature-request-form {
    margin-bottom: calc(var(--tgp-mn-height, 64px) + env(safe-area-inset-bottom, 0px) + var(--space-4));
  }
}

@media (max-width: 640px) {
  body[data-page="contact"] main > .section:first-of-type,
  body[data-page="help"] main > .section:first-of-type {
    padding-block: 22px 22px !important;
  }

  body[data-page="contact"] main > .section:first-of-type .breadcrumb,
  body[data-page="help"] main > .section:first-of-type .breadcrumb {
    display: none !important;
  }

  body[data-page="contact"] main > .section:first-of-type .section__title,
  body[data-page="help"] main > .section:first-of-type .section__title {
    margin-bottom: 10px !important;
    font-size: clamp(34px, 9vw, 40px) !important;
    line-height: 1.06 !important;
    letter-spacing: 0 !important;
  }

  body[data-page="contact"] main > .section:first-of-type .section__lead,
  body[data-page="help"] main > .section:first-of-type .section__lead {
    font-size: clamp(16px, 4.6vw, 18px) !important;
    line-height: 1.5 !important;
  }

  body[data-page="contact"] main > .section:nth-of-type(2),
  body[data-page="help"] main > .section:nth-of-type(2) {
    padding-block: 24px calc(var(--tgp-mn-height, 64px) + env(safe-area-inset-bottom, 0px) + 30px) !important;
  }

  body[data-page="contact"] main > .section:nth-of-type(2) .grid,
  body[data-page="help"] main > .section:nth-of-type(2) .grid {
    gap: 14px !important;
  }

  body[data-page="contact"] main > .section:nth-of-type(2) .card,
  body[data-page="help"] main > .section:nth-of-type(2) .card {
    padding: 18px !important;
    border-radius: 18px !important;
  }

  body[data-page="contact"] main > .section:nth-of-type(2) .card__title,
  body[data-page="help"] main > .section:nth-of-type(2) .card__title {
    font-size: clamp(24px, 6.5vw, 30px) !important;
    line-height: 1.12 !important;
  }

  body[data-page="contact"] main > .section:nth-of-type(2) .card__title {
    overflow-wrap: anywhere;
  }

  body[data-page="contact"] main > .section:nth-of-type(2) .card__body-text,
  body[data-page="help"] main > .section:nth-of-type(2) .card__body-text {
    font-size: 15px !important;
    line-height: 1.48 !important;
  }

  body[data-page="contact"] main > .section:nth-of-type(2) .btn,
  body[data-page="help"] main > .section:nth-of-type(2) .btn {
    min-height: 44px !important;
  }

  body[data-page="help"] main > .section:nth-of-type(2) .section__head {
    margin-bottom: 14px !important;
  }

  body[data-page="help"] main > .section:nth-of-type(2) .section__title {
    font-size: clamp(30px, 8.8vw, 36px) !important;
    line-height: 1.08 !important;
  }
}

/* Contact/help are already support destinations. On mobile the fixed feedback
   FAB lands on dense support cards; keep the form/content unobstructed. */
@media (max-width: 1100px) {
  body[data-page="contact"] #togo-feedback-fab,
  body[data-page="contact"] .tgp-back-to-top,
  body[data-page="help"] #togo-feedback-fab,
  body[data-page="help"] .tgp-back-to-top,
  body[data-page="faq"] #togo-feedback-fab,
  body[data-page="faq"] .tgp-back-to-top,
  body[data-page="bug-report"] #togo-feedback-fab,
  body[data-page="bug-report"] .tgp-back-to-top,
  body[data-page="feature-request"] #togo-feedback-fab,
  body[data-page="feature-request"] .tgp-back-to-top {
    display: none !important;
  }
}

/* ---- Survey-thanks card ----------------------------------------- */
.togo-survey-card {
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.12));
  border-radius: 16px;
  padding: var(--space-5) var(--space-4);
  background: var(--color-surface, rgba(255, 255, 255, 0.03));
  display: grid;
  gap: var(--space-3);
  text-align: center;
}
.togo-survey-card__eyebrow {
  margin: 0;
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.togo-survey-card__stars {
  display: flex;
  justify-content: center;
  gap: 6px;
  font-size: 30px;
  line-height: 1;
}
.togo-survey-card__star {
  color: var(--color-text-muted);
  transition: color 120ms ease, transform 120ms ease;
}
.togo-survey-card__star[data-active="true"] {
  color: var(--color-accent, gold);
  transform: scale(1.06);
}
.togo-survey-card__ref {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-soft);
}
.togo-survey-card__ref[hidden] { display: none; }
.togo-survey-card__ref-label {
  color: var(--color-text-muted);
  margin-right: 4px;
}
.togo-survey-card__ref code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--color-text);
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--color-bg-elevated, rgba(255, 255, 255, 0.04));
}
.togo-survey-card__hint {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
