/**
 * Contact Support Styles — Gist Brand-Aligned
 *
 * What this file is:
 * - Styles for the public support-form page at gist.is/help/contact.
 * - Covers header, footer, login form, support form, voice recording, attachments.
 * - Ported from extension support-message-modal.css with full-page adaptations.
 *
 * Why this file exists:
 * - The contact-support page needs its own stylesheet (not bundled in admin.css).
 * - Keeps support-form styles isolated from other pages.
 * - Matches the Gist brand system (brand.ts / brand.css).
 *
 * Brand alignment (v3.6 dark-first):
 * - Colors resolve via `var(--ink)` / `var(--paper)` / `var(--wash)` etc.
 *   tokens.css declares them; home.css forces the dark variant on /help so
 *   the surface matches the homepage.
 * - Typography uses Instrument Sans (brand typeface) via `var(--font-sans)`.
 * - Sunrise gradient (`var(--gradient)`) is the brand verb on CTA buttons.
 * - Spacing follows the 4px grid (`--help-space-*` page-local scale).
 * - Site nav + footer come from site-shell.ts (renderSiteNav / renderSiteFooter);
 *   this file no longer owns header/footer chrome.
 *
 * Related files:
 * - packages/backend/src/ssr/help-contact.ts (loads this stylesheet)
 * - packages/backend/src/ssr/brand.ts (brand constants — colors, fonts, wordmark)
 * - packages/backend/src/client/help-contact.ts (renders the UI)
 * - packages/chrome-plugin/extension/ui/brand.css (extension design system)
 */

/* ============================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   Brand tokens (`--help-*`) ship from `src/styles/tokens.css` — the
   help-contact SSR shell links it before this file so the cascade
   resolves via shared `--ink` / `--paper` / `--wash`. Page-local
   tokens that are NOT derived from the shared palette stay here.
   ============================================ */
:root {
  /* Feedback (page-local — not in shared tokens.css) */
  --help-error-wash: #fef2f2;
  --help-success-wash: rgba(16, 185, 129, 0.12);
  --help-accent: var(--gradient-start);

  /* Spacing — 4px grid */
  --help-space-1: 4px;
  --help-space-2: 8px;
  --help-space-3: 12px;
  --help-space-4: 16px;
  --help-space-5: 20px;
  --help-space-6: 24px;
  --help-space-8: 32px;

  /* Shadows */
  --help-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --help-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --help-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --help-shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.08);

  /* Radii — matches brand.css scale */
  --help-radius-sm: 8px;
  --help-radius-md: 12px;
  --help-radius-lg: 16px;
  --help-radius-xl: 20px;
  --help-radius-full: 9999px;
}

/* ============================================
   BASE STYLES
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

/*
 * Body baseline and chrome layout come from home.css (the dark token cascade,
 * .nav, .footer-* styles all live there). This file owns only the /help
 * main area, the support form, and the loading/error states.
 */

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.help-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 96px;
  padding-bottom: 48px;
}

/* ============================================
   CONTAINER
   ============================================ */
.help-container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--help-space-6);
}

/* ============================================
   LOADING STATE
   ============================================ */
.help-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--help-space-4);
  padding: var(--help-space-8);
}

.help-loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--gradient-start);
  border-radius: 50%;
  animation: help-spin 0.8s linear infinite;
}

@keyframes help-spin {
  to { transform: rotate(360deg); }
}

.help-loading__text {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.9375rem;
}

/* ============================================
   PAGE LAYOUT
   ============================================ */
.help-page {
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--help-space-6);
  animation: help-fade-in 0.4s ease-out;
}

@keyframes help-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   HEADER (in-page)
   ============================================ */
.help-page__header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--help-space-3);
}

.help-page__header--compact {
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: var(--help-space-3);
  text-align: right;
  padding: 0;
  border-bottom: 0;
  margin-bottom: var(--help-space-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.help-page__header--compact .help-page__user,
.help-page__header--compact .help-page__email {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.help-page__wordmark {
  display: flex;
  align-items: center;
  gap: var(--help-space-2);
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.25rem;
}

.help-page__wordmark svg {
  width: 28px;
  height: 44px;
}

.help-page__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--help-radius-md);
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-page__icon svg {
  width: 28px;
  height: 28px;
  color: var(--paper);
}

.help-page__title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.help-page__subtitle {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 1rem;
  max-width: 320px;
}

.help-page__user {
  display: flex;
  align-items: center;
  gap: var(--help-space-3);
}

.help-page__email {
  font-size: 0.875rem;
  color: var(--ink-secondary);
}

.help-page__signout {
  padding: var(--help-space-2) var(--help-space-3);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-tertiary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--help-radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.help-page__signout:hover {
  background: var(--wash);
  color: var(--ink);
}

/* ============================================
   LOGIN FORM
   ============================================ */
.help-login {
  background: var(--paper);
  border-radius: var(--help-radius-xl);
  padding: var(--help-space-8);
  box-shadow: var(--help-shadow-xl);
  border: 1px solid var(--border-light);
}

.help-login__error {
  margin: 0 0 var(--help-space-4) 0;
  padding: var(--help-space-3) var(--help-space-4);
  background: var(--help-error-wash);
  border: 1px solid var(--error);
  border-radius: var(--help-radius-sm);
  font-size: 0.875rem;
  color: var(--error);
}

.help-login__form {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-4);
}

.help-form-field {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-2);
}

.help-form-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.help-form-field input {
  width: 100%;
  padding: var(--help-space-3) var(--help-space-4);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--help-radius-md);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.help-form-field input::placeholder {
  color: var(--ink-faint);
}

.help-form-field input:focus {
  outline: none;
  border-color: var(--gradient-start);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

.help-login__divider {
  display: flex;
  align-items: center;
  gap: var(--help-space-4);
  margin: var(--help-space-5) 0;
  color: var(--ink-faint);
  font-size: 0.8125rem;
}

.help-login__divider::before,
.help-login__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.help-login__note {
  margin: var(--help-space-5) 0 0 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--ink-secondary);
}

.help-login__note a {
  color: var(--gradient-start);
  font-weight: 600;
  text-decoration: none;
}

.help-login__note a:hover {
  text-decoration: underline;
}

/* ============================================
   BUTTONS
   ============================================ */
.help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--help-space-2);
  width: 100%;
  padding: var(--help-space-4);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: var(--help-radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.help-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/*
 * Brand ink-pill button. Mirrors home.css `.cta-primary` — the gradient is
 * NOT the button surface (that's the cream-era slab pattern); the button is
 * ink, the bolt symbol inside is accent. "The button is the calm; the bolt
 * is the heat." (Brand guide v3.5 components section.)
 */
.help-btn--primary {
  color: var(--paper);
  background: var(--ink);
  border-radius: var(--help-radius-full);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
}

.help-btn--primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.44);
}

.help-btn--google {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border);
}

.help-btn--google:not(:disabled):hover {
  background: var(--wash);
}

.help-btn--ghost {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border);
}

.help-btn--ghost:not(:disabled):hover {
  background: var(--wash);
}

.help-btn--google svg {
  flex-shrink: 0;
}

/* ============================================
   FORM CARD
   ============================================ */
.help-form-card {
  background: var(--paper);
  border-radius: var(--help-radius-xl);
  padding: var(--help-space-8);
  box-shadow: var(--help-shadow-xl);
  border: 1px solid var(--border-light);
}

.help-form-card__header {
  display: flex;
  align-items: flex-start;
  gap: var(--help-space-4);
  margin-bottom: var(--help-space-5);
}

.help-form-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--help-radius-md);
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 217, 61, 0.1), rgba(255, 142, 83, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.help-form-card__icon svg {
  width: 24px;
  height: 24px;
  color: var(--gradient-start);
}

.help-form-card__title {
  margin: 0 0 2px 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.help-form-card__subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-tertiary);
}

/* ============================================
   FORM CONTENT
   ============================================ */
.help-form-error {
  margin: 0 0 var(--help-space-4) 0;
  padding: var(--help-space-3) var(--help-space-4);
  background: var(--help-error-wash);
  border: 1px solid var(--error);
  border-radius: var(--help-radius-sm);
  font-size: 0.875rem;
  color: var(--error);
}

.help-form-error--info {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
  color: #1d4ed8;
}

.help-form-description {
  margin: 0 0 var(--help-space-4) 0;
  font-size: 0.9375rem;
  color: var(--ink-secondary);
  line-height: 1.55;
}

/* ============================================
   EXTENSION DEBUG TOGGLE
   ============================================ */
.help-debug {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-3);
  padding: var(--help-space-5);
  margin-bottom: var(--help-space-4);
  border-radius: var(--help-radius-lg);
  background: var(--wash);
  border: 1px solid var(--border);
}

.help-debug__header {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-2);
}

.help-debug__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.help-debug__subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-tertiary);
  line-height: 1.5;
}

.help-debug__status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--help-space-4);
}

.help-debug__status-left {
  display: flex;
  align-items: center;
  gap: var(--help-space-2);
  flex-wrap: wrap;
}

.help-debug__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink-faint);
}

.help-debug__dot--pending {
  background: var(--ink-faint);
}

.help-debug__dot--ok {
  background: #10B981;
}

.help-debug__dot--active {
  background: #f97316;
}

.help-debug__dot--warn {
  background: #f59e0b;
}

.help-debug__dot--error {
  background: #ef4444;
}

.help-debug__status-text {
  font-size: 0.875rem;
  color: var(--ink);
  font-weight: 600;
}

.help-debug__version {
  font-size: 0.75rem;
  color: var(--ink-tertiary);
}

.help-debug__toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.help-toggle-input {
  appearance: none;
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 999px;
  border: none;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}

.help-toggle-input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper);
  transition: transform 0.2s ease;
  box-shadow: var(--help-shadow-sm);
}

.help-toggle-input:checked {
  background: var(--gradient-start);
}

.help-toggle-input:checked::after {
  transform: translateX(20px);
}

.help-toggle-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.help-toggle-pill {
  display: none;
}

.help-debug__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--help-space-2) var(--help-space-4);
  border-radius: var(--help-radius-full);
  border: 1px solid var(--border);
  background: var(--paper);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.15s ease;
  width: fit-content;
}

.help-debug__cta:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.help-debug-consent {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-3);
  padding: var(--help-space-4);
  border-radius: var(--help-radius-md);
  background: var(--paper);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.help-debug-consent__copy {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-tertiary);
}

.help-debug-consent__actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--help-space-3);
}

/* ============================================
   MESSAGE INPUT
   ============================================ */
.help-message {
  margin-bottom: var(--help-space-4);
}

.help-message textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--help-space-4);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--help-radius-md);
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  line-height: 1.5;
}

.help-message textarea::placeholder {
  color: var(--ink-faint);
}

.help-message textarea:focus {
  outline: none;
  border-color: var(--gradient-start);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

.help-char-count {
  text-align: right;
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-top: var(--help-space-2);
}

/* ============================================
   VOICE NOTE
   ============================================ */
.help-attachments {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-4);
  margin-bottom: var(--help-space-6);
}

.help-voice-block {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-3);
}

.help-voice-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--help-space-3);
  padding: var(--help-space-6);
  background: var(--wash);
  border-radius: var(--help-radius-lg);
}

.help-record-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--gradient);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
}

.help-record-btn svg {
  width: 32px;
  height: 32px;
  color: var(--paper);
}

.help-record-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.help-record-btn:active {
  transform: scale(0.98);
}

.help-record-hint {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
}

.help-record-limit {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-tertiary);
}

/* Voice recorder (recording state) */
.help-voice-recorder {
  background: var(--wash);
  border-radius: var(--help-radius-lg);
  padding: var(--help-space-6);
}

.help-recorder-active {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--help-space-4);
}

.help-recording-indicator {
  display: flex;
  align-items: center;
  gap: var(--help-space-2);
}

.help-rec-dot {
  width: 12px;
  height: 12px;
  background: #ff4444;
  border-radius: 50%;
  animation: help-rec-pulse 1s ease-in-out infinite;
}

@keyframes help-rec-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.help-rec-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ff4444;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.help-recording-timer {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.help-waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 48px;
}

.help-wave-bar {
  width: 4px;
  height: 20px;
  background: var(--gradient-start);
  border-radius: 2px;
  animation: help-wave-anim 0.8s ease-in-out infinite;
}

.help-wave-bar:nth-child(1) { animation-delay: 0s; }
.help-wave-bar:nth-child(2) { animation-delay: 0.1s; }
.help-wave-bar:nth-child(3) { animation-delay: 0.2s; }
.help-wave-bar:nth-child(4) { animation-delay: 0.3s; }
.help-wave-bar:nth-child(5) { animation-delay: 0.4s; }
.help-wave-bar:nth-child(6) { animation-delay: 0.3s; }
.help-wave-bar:nth-child(7) { animation-delay: 0.2s; }
.help-wave-bar:nth-child(8) { animation-delay: 0.1s; }
.help-wave-bar:nth-child(9) { animation-delay: 0s; }

@keyframes help-wave-anim {
  0%, 100% { height: 20px; }
  50% { height: 40px; }
}

.help-stop-btn {
  display: flex;
  align-items: center;
  gap: var(--help-space-2);
  padding: var(--help-space-3) var(--help-space-5);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--help-radius-full);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.help-stop-btn svg {
  width: 16px;
  height: 16px;
  color: #ff4444;
}

.help-stop-btn:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* Voice playback */
.help-voice-playback {
  background: var(--wash);
  border-radius: var(--help-radius-lg);
  padding: var(--help-space-5);
}

.help-playback-header {
  display: flex;
  align-items: center;
  gap: var(--help-space-2);
  margin-bottom: var(--help-space-4);
}

.help-playback-header svg {
  width: 18px;
  height: 18px;
  color: var(--ink-tertiary);
}

.help-playback-header span {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}

.help-remove-voice {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--ink-faint);
  cursor: pointer;
  transition: all 0.15s ease;
}

.help-remove-voice svg {
  width: 16px;
  height: 16px;
}

.help-remove-voice:hover {
  background: var(--help-error-wash);
  color: var(--error);
}

.help-playback-controls {
  display: flex;
  align-items: center;
  gap: var(--help-space-4);
}

.help-play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ink);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.help-play-btn svg {
  width: 20px;
  height: 20px;
  color: var(--paper);
  margin-left: 2px;
}

.help-play-btn:hover {
  transform: scale(1.05);
}

.help-playback-progress {
  flex: 1;
  min-width: 0;
}

.help-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.help-progress-fill {
  height: 100%;
  background: var(--gradient);
  width: 0%;
  transition: width 0.1s linear;
}

.help-progress-time {
  display: flex;
  justify-content: space-between;
  margin-top: var(--help-space-2);
  font-size: 0.75rem;
  color: var(--ink-tertiary);
  font-variant-numeric: tabular-nums;
}

.help-rerecord-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--help-space-2);
  padding: var(--help-space-2) var(--help-space-4);
  margin-top: var(--help-space-3);
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-tertiary);
  cursor: pointer;
  transition: color 0.15s ease;
}

.help-rerecord-btn svg {
  width: 16px;
  height: 16px;
}

.help-rerecord-btn:hover {
  color: var(--ink);
}

/* ============================================
   ATTACHMENTS
   ============================================ */
.help-attachment-block {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-3);
  padding: var(--help-space-5);
  background: var(--wash);
  border-radius: var(--help-radius-lg);
}

.help-attachment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--help-space-3);
  flex-wrap: wrap;
}

.help-attachment-copy {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-1);
  flex: 1;
  min-width: 200px;
}

.help-attachment-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
}

.help-attachment-note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-tertiary);
}

.help-attachment-button {
  padding: var(--help-space-2) var(--help-space-4);
  border-radius: var(--help-radius-full);
  border: 1px solid var(--border);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.help-attachment-button:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.help-attachments-input {
  display: none;
}

.help-attachments-list {
  display: flex;
  flex-direction: column;
  gap: var(--help-space-2);
}

.help-attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--help-space-3);
  padding: var(--help-space-3);
  border-radius: var(--help-radius-md);
  border: 1px solid var(--border);
  background: var(--paper);
}

.help-attachment-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.help-attachment-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.help-attachment-details {
  font-size: 0.75rem;
  color: var(--ink-tertiary);
}

.help-attachment-remove {
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-tertiary);
  cursor: pointer;
  transition: color 0.15s ease;
}

.help-attachment-remove:hover {
  color: var(--ink);
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */
.help-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--help-space-2);
  width: 100%;
  padding: var(--help-space-4) var(--help-space-5);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--paper);
  background: var(--gradient);
  border: none;
  border-radius: var(--help-radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.25);
}

.help-submit svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.help-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.help-submit:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.35);
}

.help-submit:not(:disabled):hover svg {
  transform: translateX(2px);
}

.help-submit--ghost {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: none;
}

.help-submit--ghost:not(:disabled):hover {
  background: var(--wash);
  transform: translateY(-1px);
  box-shadow: none;
}

/* ============================================
   SUCCESS STATE
   ============================================ */
.help-success {
  text-align: center;
  padding: var(--help-space-4) 0;
}

.help-success__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--help-space-4) auto;
  border-radius: 50%;
  background: var(--help-success-wash);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
}

.help-success__icon svg {
  width: 28px;
  height: 28px;
}

.help-success h3 {
  margin: 0 0 var(--help-space-2) 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
}

.help-success p {
  margin: 0 0 var(--help-space-4) 0;
  font-size: 0.9375rem;
  color: var(--ink-secondary);
  line-height: 1.5;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
  .help-container {
    padding: var(--help-space-4);
  }

  .help-login,
  .help-form-card {
    padding: var(--help-space-6);
  }

  .help-page__header--compact {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--help-space-3);
  }

  .help-page__user {
    width: 100%;
    justify-content: space-between;
  }

  .help-attachment-header {
    flex-direction: column;
    align-items: stretch;
  }

  .help-attachment-button {
    width: 100%;
    text-align: center;
  }

  .help-debug-consent-btn {
    width: 100%;
  }

  .help-header__nav {
    gap: 20px;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .help-page,
  .help-loading__spinner,
  .help-record-btn,
  .help-rec-dot,
  .help-wave-bar {
    animation: none;
  }

  .help-submit,
  .help-btn,
  .help-record-btn {
    transition: none;
  }
}

/* ============================================
   HIDDEN UTILITY
   ============================================ */
[hidden] {
  display: none !important;
}

/* ============================================
   FORM STATE — quiet brand color treatment per state.
   Apply on .help-form-card; the controller toggles the modifier class
   when the request enters / leaves submit / success / error.
   ============================================ */
.help-form-card.help-form--submitting { opacity: 0.85; pointer-events: none; }
.help-form-card.help-form--success {
  border-color: var(--success);
  box-shadow: 0 0 0 1px var(--success), 0 24px 60px rgba(16, 185, 129, 0.18);
}
.help-form-card.help-form--success .help-form-card__title { color: var(--success); }
.help-form-card.help-form--error {
  border-color: var(--error);
  box-shadow: 0 0 0 1px var(--error), 0 24px 60px rgba(220, 38, 38, 0.18);
}
.help-form-card.help-form--error .help-form-card__title { color: var(--error); }

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
