/* ============================================================
   ThatcherFeedback — shared widget styles
   Self-contained on purpose: uses only its own --tf-* custom properties
   (set by feedback-widget.js's init()) plus hardcoded neutrals, never the
   host app's own design tokens. Apps' internal variable names drifted
   (Food uses its original --charcoal/--surface names, Edu/Garden/HQ use
   the shared-system --ink/--card names) — this file has to work
   identically regardless of that, so it doesn't reference either set.
   Keep this file identical across all 4 apps, same as feedback-widget.js.
   ============================================================ */

.tf-widget-root {
  position: fixed;
  inset: 0;
  z-index: 9999;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  pointer-events: none;
}

.tf-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tf-sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  background: #FFFFFF;
  border-radius: 24px 24px 0 0;
  padding: 14px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(.32,.72,0,1), opacity 0.2s ease;
}

.tf-widget-root.tf-open { pointer-events: auto; }
.tf-widget-root.tf-open .tf-backdrop { opacity: 1; }
.tf-widget-root.tf-open .tf-sheet { transform: translate(-50%, 0); opacity: 1; }

@media (min-width: 640px) {
  .tf-sheet {
    left: 50%;
    bottom: 50%;
    transform: translate(-50%, calc(50% + 24px));
    border-radius: 24px;
    max-height: 80vh;
  }
  .tf-widget-root.tf-open .tf-sheet { transform: translate(-50%, 50%); }
}

.tf-handle {
  width: 36px; height: 4px;
  background: #E3E3E3;
  border-radius: 2px;
  margin: 0 auto 16px;
}
@media (min-width: 640px) { .tf-handle { display: none; } }

.tf-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.tf-header h2 { font-size: 19px; font-weight: 800; margin: 0; color: #1E1E1E; }
.tf-close {
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: #F0F0F0; color: #333;
  font-size: 20px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.tf-step.tf-hidden { display: none; }

.tf-label {
  font-size: 12.5px; font-weight: 800; color: #1E1E1E;
  margin: 0 0 8px;
}

.tf-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tf-type-btn {
  text-align: left;
  border: 2px solid #ECECEC;
  background: #FAFAFA;
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tf-type-btn strong { font-size: 14px; color: #1E1E1E; }
.tf-type-btn span { font-size: 11.5px; color: #757575; line-height: 1.35; }
.tf-type-btn.active {
  border-color: var(--tf-accent, #2F6FED);
  background: var(--tf-accent-soft, #EEF3FF);
}
.tf-type-btn.active strong { color: var(--tf-accent-dark, var(--tf-accent, #2F6FED)); }

.tf-input, .tf-textarea, .tf-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid #E3E3E3;
  font-size: 15px;
  font-family: inherit;
  color: #1E1E1E;
  margin-bottom: 14px;
  outline: none;
  box-sizing: border-box;
}
.tf-textarea { min-height: 90px; resize: vertical; }
.tf-input:focus, .tf-textarea:focus, .tf-select:focus {
  border-color: var(--tf-accent, #2F6FED);
}

.tf-back {
  border: none; background: none;
  color: #757575; font-weight: 700; font-size: 13px;
  cursor: pointer; padding: 8px 0; margin-bottom: 4px;
}

.tf-submit {
  width: 100%;
  border: none;
  background: var(--tf-accent, #2F6FED);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  padding: 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
.tf-submit:hover { background: var(--tf-accent-dark, var(--tf-accent, #2F6FED)); }
.tf-submit:active { transform: scale(0.98); }
.tf-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.tf-error {
  color: #C84F48;
  font-size: 12.5px;
  font-weight: 700;
  margin: 10px 0 0;
  text-align: center;
}

.tf-step[data-tf-step="done"] {
  text-align: center;
  padding: 20px 0 4px;
}
.tf-done-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--tf-accent-soft, #EEF3FF);
  color: var(--tf-accent-dark, var(--tf-accent, #2F6FED));
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin: 0 auto 14px;
}
.tf-done-title { font-size: 16px; font-weight: 800; color: #1E1E1E; margin: 0 0 4px; }
.tf-done-title span { color: var(--tf-accent-dark, var(--tf-accent, #2F6FED)); }
.tf-done-sub { font-size: 13px; color: #757575; margin: 0 0 20px; }

/* ---------- Default trigger row (menu-item style, used inside an
   existing "More"/settings surface) ---------- */
.tf-trigger-row {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  border: none; background: none;
  padding: 14px 4px;
  font-family: inherit;
  font-size: 15px; font-weight: 600;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
