/* ============================================
   Public toolbar — theme + language picker on
   public pages (landing, privacy, terms, support).
   The theme button reuses .settings-btn so it is visually identical to
   the logged-in header toggle.
   ============================================ */

/* Canonical .settings-btn definition — same rules as inline.css but
   duplicated here so legal/support pages (which don't load inline.css)
   still get the logged-in look. If inline.css is also loaded (landing),
   the identical rules are harmless. */
.settings-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--ms-text-muted, #6b7280);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.settings-btn:hover,
.settings-btn.active {
  color: var(--ms-primary, #6366f1);
  background: var(--ms-primary-light, rgba(99, 102, 241, 0.08));
}
.settings-btn svg { width: 18px; height: 18px; }
.settings-btn:focus-visible {
  outline: 2px solid var(--ms-primary, #6366f1);
  outline-offset: 2px;
}


.public-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

/* Language selector — flat native <select>, no "chip" wrapper. This is the
   fix for the dark-mode band that appeared under the selector: the old
   wrapper had background: var(--ms-bg) which in dark theme turned into
   #0f172a and stacked against the header (var(--ms-surface) = #1e293b),
   producing a visible dark rectangle. The flat control uses only the
   inherited surface + text tokens, so it blends in every theme. */
.public-toolbar__lang {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.public-toolbar__select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 22px 6px 8px;
  color: var(--ms-text-muted, #6b7280);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  /* Chevron — uses currentColor so it follows the theme automatically. */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='currentColor'><path d='M1 3l4 4 4-4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 10px 10px;
}
.public-toolbar__select:hover {
  color: var(--ms-primary, #6366f1);
  background-color: var(--ms-primary-light, rgba(99, 102, 241, 0.08));
}
.public-toolbar__select:focus-visible {
  outline: 2px solid var(--ms-primary, #6366f1);
  outline-offset: 2px;
}

/* Theme button — `.settings-btn` from inline.css handles look + hover.
   This rule only adds icon-slot layout (no visual styling of its own). */
.public-toolbar__theme {
  position: relative;
}
.public-toolbar__theme [data-theme-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

/* Hero variant — when placed over the landing purple gradient, flip
   colors to white so it reads on the dark background. Both controls
   share the same treatment so they line up perfectly. */
.public-toolbar.is-on-hero .public-toolbar__select,
.public-toolbar.is-on-hero .settings-btn {
  color: rgba(255, 255, 255, 0.92);
}
.public-toolbar.is-on-hero .public-toolbar__select:hover,
.public-toolbar.is-on-hero .settings-btn:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.14);
}
.public-toolbar.is-on-hero .public-toolbar__select option {
  /* Native option list — let it follow the user's OS theme via
     color-scheme; fall back to a readable dark-on-light pair. */
  color: #111827;
  background-color: #ffffff;
}

/* Screen-reader only helper (if not already defined) */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   Support form
   ============================================ */
.support-form {
  display: grid;
  gap: 16px;
  max-width: 680px;
}
.support-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.support-form__field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ms-text, #111827);
}
.support-form__field input,
.support-form__field textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--ms-text, #111827);
  background: var(--ms-surface, #fff);
  border: 1px solid var(--ms-border, #d1d5db);
  border-radius: 8px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.support-form__field textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
  font-family: inherit;
}
.support-form__field input:focus,
.support-form__field textarea:focus {
  outline: none;
  border-color: var(--ms-primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.support-form__field input.has-error,
.support-form__field textarea.has-error {
  border-color: var(--ms-error, #ef4444);
}
.support-form__field small {
  font-size: 0.75rem;
  color: var(--ms-text-muted, #64748b);
}
.support-form__hint-error {
  font-size: 0.8125rem;
  color: var(--ms-error, #ef4444);
}
.support-form__consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--ms-text-secondary, #475569);
  line-height: 1.5;
}
.support-form__consent input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}
.support-form__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}
.support-form__submit {
  padding: 10px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  background: var(--ms-primary, #6366f1);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 150ms ease, opacity 150ms ease;
}
.support-form__submit:hover {
  background: var(--ms-primary-hover, #4f46e5);
}
.support-form__submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

.support-form__feedback {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.5;
}
.support-form__feedback.is-success {
  background: var(--ms-success-light, #d1fae5);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.support-form__feedback.is-error {
  background: var(--ms-error-light, #fee2e2);
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Honeypot — visually hidden but focusable-if-targeted bots */
.support-form__honeypot {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
