/* ==========================================================================
   Ticket form (assets/js/ticket-form.js). Used on support.html and inside the chat panel.
   Two columns where there's room; one column on phones and in the chat panel.
   ========================================================================== */

.tf-warn {
  padding: 0.875rem 1rem;
  border-radius: 12px;
  background: var(--color-brand-soft);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.tf-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
  margin-top: 1.25rem;
}

.tf-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
}

.tf-field label {
  font-size: 0.9375rem;
  font-weight: 600;
}

.tf-opt {
  color: var(--color-muted);
  font-weight: 400;
}

.tf-field input,
.tf-field select,
.tf-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.875rem;
  border: 1.5px solid var(--color-line);
  border-radius: 12px;
  background: var(--color-card);
  color: var(--color-ink);
  font: inherit;
  font-size: 1rem; /* 16px: stops iOS zooming in on focus */
  transition: border-color 180ms;
}

.tf-field textarea {
  resize: vertical;
  line-height: 1.5;
}

.tf-field input:focus,
.tf-field select:focus,
.tf-field textarea:focus {
  border-color: var(--color-brand);
  outline: none;
}

.tf-field [aria-invalid="true"] {
  border-color: #c62828;
}

.tf-error {
  display: none;
  color: #c62828;
  font-size: 0.875rem;
  line-height: 1.4;
}

.tf-error.is-shown {
  display: block;
}

.tf-check {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  cursor: pointer;
}

.tf-check input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--color-brand);
}

.tf-check + .tf-error {
  margin-top: 0.375rem;
}

.tf-error-send {
  margin-top: 1rem;
}

.tf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.tf-actions .btn-primary[aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.tf-done {
  padding: 1rem 0;
  text-align: center;
}

.tf-done .icon-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.tf-done h3 {
  margin: 1rem 0 0;
  font-size: 1.5rem;
  font-weight: 700;
  outline: none;
}

.tf-done p {
  margin-top: 0.75rem;
  color: var(--color-muted);
  line-height: 1.5;
}

.tf-done .btn {
  margin-top: 1.5rem;
}

.tf-ref {
  color: var(--color-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tf-demo-note {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: var(--color-page);
  font-size: 0.875rem;
}

/* Inside the chat panel: one column, tighter spacing, buttons full width. */
.chat-panel .tf-row {
  grid-template-columns: minmax(0, 1fr);
}

.chat-panel .tf-field {
  margin-top: 1rem;
}

.chat-panel .tf-warn {
  font-size: 0.875rem;
}

.chat-panel .tf-actions .btn {
  flex: 1 1 auto;
}

@media (max-width: 599px) {
  .tf-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
