/* burn_form — controlled-burn report form section.
 *
 * All rules are scoped under .section-burn-form so they don't leak to
 * the rest of the page. Built against the site's theme tokens
 * (--color-primary, --color-accent, etc.) — no Tailwind, no overrides
 * to base.css.
 */

.section-burn-form .section-inner {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.section-burn-form .is-hidden { display: none !important; }

/* ─── Cards ─────────────────────────────────────────────────────────── */

.section-burn-form .bf-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
}

.section-burn-form .bf-card h2 {
  font-size: var(--font-lg);
  margin: 0 0 var(--space-xs);
  color: var(--color-heading);
}

.section-burn-form .bf-intro {
  margin: 0 0 var(--space-md);
  font-size: var(--font-sm);
  color: var(--color-muted);
}

.section-burn-form .bf-req { color: var(--color-accent); }

/* ─── Form layout ───────────────────────────────────────────────────── */

.section-burn-form .bf-form {
  display: grid;
  gap: var(--space-md);
}

.section-burn-form .bf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-burn-form .bf-field > label {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--color-text);
}

.section-burn-form .bf-hint {
  font-size: var(--font-xs);
  color: var(--color-muted);
}

/* ─── Segmented control (contact method) ───────────────────────────── */

.section-burn-form .bf-segmented {
  display: inline-flex;
  align-self: flex-start;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 3px;
  gap: 3px;
}

.section-burn-form .bf-segment {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 8px var(--space-md);
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--color-muted);
  border-radius: 2px;
  user-select: none;
  transition: background-color 120ms ease, color 120ms ease;
  min-height: 34px;
}

.section-burn-form .bf-segment input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.section-burn-form .bf-segment:has(input:checked) {
  background: var(--color-primary);
  color: var(--color-primary-fg);
}

.section-burn-form .bf-segment:has(input:focus-visible) {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.section-burn-form .bf-segment:hover:not(:has(input:checked)) {
  background: var(--color-bg);
  color: var(--color-text);
}

/* ─── Inputs ────────────────────────────────────────────────────────── */

.section-burn-form .bf-input {
  width: 100%;
  padding: 10px var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--color-text);
  font-size: var(--font-md);
  font-family: var(--font-body);
  line-height: 1.3;
  min-height: 44px;
}

.section-burn-form .bf-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(29, 47, 71, 0.18);
}

.section-burn-form .bf-textarea {
  min-height: 110px;
  resize: vertical;
  font-family: var(--font-body);
}

/* ─── Buttons ───────────────────────────────────────────────────────── */

.section-burn-form .bf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 44px;
  padding: 10px var(--space-lg);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: var(--font-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.section-burn-form .bf-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.section-burn-form .bf-btn--primary {
  background: var(--color-accent);
  color: var(--color-accent-fg);
}
.section-burn-form .bf-btn--primary:hover:not(:disabled) {
  background: var(--color-accent-hover);
}

.section-burn-form .bf-btn--secondary {
  background: var(--color-primary);
  color: var(--color-primary-fg);
}
.section-burn-form .bf-btn--secondary:hover:not(:disabled) {
  background: #243a59;
}
.section-burn-form .bf-btn--secondary svg {
  width: 16px;
  height: 16px;
}

.section-burn-form .bf-btn--complete {
  background: var(--color-success);
  color: #ffffff;
}
.section-burn-form .bf-btn--complete:hover:not(:disabled) {
  background: #2f8e5b;
}

.section-burn-form .bf-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* ─── GPS row ───────────────────────────────────────────────────────── */

.section-burn-form .bf-gps-row {
  display: flex;
  gap: var(--space-sm);
  align-items: stretch;
}

.section-burn-form .bf-gps-input { flex: 1 1 auto; min-width: 0; }

.section-burn-form .bf-gps-row .bf-btn { flex: 0 0 auto; white-space: nowrap; }

.section-burn-form .bf-gps-map-wrap {
  margin-top: 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-bg);
}

.section-burn-form .bf-gps-map {
  display: block;
  width: 100%;
  height: 220px;
  border: 0;
}

.section-burn-form .bf-gps-link {
  color: var(--color-primary);
  text-decoration: underline;
}

@media (max-width: 540px) {
  .section-burn-form .bf-gps-row { flex-direction: column; }
  .section-burn-form .bf-gps-row .bf-btn { width: 100%; }
}

/* ─── Duration stepper ──────────────────────────────────────────────── */

.section-burn-form .bf-duration-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.section-burn-form .bf-stepper {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 120ms ease;
}
.section-burn-form .bf-stepper:hover:not(:disabled) {
  background: rgba(29, 47, 71, 0.08);
}
.section-burn-form .bf-stepper:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.section-burn-form .bf-stepper:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.section-burn-form .bf-duration-select {
  flex: 1 1 auto;
  min-width: 6rem;
  padding: 10px var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background-color: #ffffff;
  color: var(--color-text);
  font-size: var(--font-md);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none' stroke='%231d2f47' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='5 8 10 13 15 8'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
  padding-right: 36px;
  min-height: 44px;
}
.section-burn-form .bf-duration-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(29, 47, 71, 0.18);
}

/* ─── Submit row ────────────────────────────────────────────────────── */

.section-burn-form .bf-submit-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  justify-content: flex-end;
}

.section-burn-form .bf-form-error {
  margin: 0;
  flex: 1 1 auto;
  font-size: var(--font-sm);
  color: var(--color-danger);
}

/* ─── Banners ───────────────────────────────────────────────────────── */

.section-burn-form .bf-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-left: 4px solid var(--color-success);
  background: #e8f1e6;
  border-radius: var(--radius);
}

.section-burn-form .bf-banner-body { flex: 1 1 auto; min-width: 0; }

.section-burn-form .bf-banner-title {
  margin: 0 0 4px;
  font-weight: 700;
  color: #234221;
}
.section-burn-form .bf-banner-text {
  margin: 0;
  font-size: var(--font-sm);
  color: var(--color-text);
}

.section-burn-form .bf-banner-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--color-muted);
  cursor: pointer;
  border-radius: var(--radius);
}
.section-burn-form .bf-banner-close:hover { background: rgba(0, 0, 0, 0.05); }

/* ─── My reports ───────────────────────────────────────────────────── */

.section-burn-form .bf-mine { margin-top: var(--space-md); }

.section-burn-form .bf-mine-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
}

.section-burn-form .bf-mine-header h2 {
  margin: 0;
  font-size: var(--font-lg);
}

.section-burn-form .bf-mine-count {
  font-size: var(--font-sm);
  color: var(--color-muted);
}

.section-burn-form .bf-mine-intro {
  margin: 4px 0 var(--space-md);
  font-size: var(--font-sm);
  color: var(--color-muted);
}

.section-burn-form .bf-mine-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.section-burn-form .bf-mine-archived {
  margin-top: var(--space-md);
}

.section-burn-form .bf-mine-archived > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: var(--font-sm);
  color: var(--color-muted);
  list-style: revert;
}

.section-burn-form .bf-mine-empty {
  margin-top: var(--space-md);
  padding: var(--space-lg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  font-size: var(--font-sm);
  color: var(--color-muted);
  text-align: center;
}

/* ─── Burn cards (My reports) ──────────────────────────────────────── */

.section-burn-form .bf-burn-card { padding: var(--space-md); }

.section-burn-form .bf-burn-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
}

.section-burn-form .bf-burn-card-heading {
  flex: 1 1 200px;
  min-width: 0;
}

.section-burn-form .bf-burn-address {
  font-weight: 600;
  font-size: var(--font-md);
  word-break: break-word;
}

.section-burn-form .bf-burn-time {
  margin-top: 2px;
  font-size: var(--font-xs);
  color: var(--color-muted);
}

/* Burn-window countdown — mirrors the admin dashboard chip but tuned
 * for the public form's lighter card aesthetic. */
.section-burn-form .bf-burn-card-window {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: var(--radius);
  background: rgba(56, 161, 105, 0.10);
  color: #2f7a4f;
  border: 1px solid rgba(56, 161, 105, 0.30);
  font-variant-numeric: tabular-nums;
  max-width: 100%;
}

.section-burn-form .bf-burn-card-window.is-overdue {
  background: rgba(192, 57, 43, 0.10);
  color: #b03a2e;
  border-color: rgba(192, 57, 43, 0.40);
}

.section-burn-form .bf-burn-card-window-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.section-burn-form .bf-burn-card-window-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--font-sm);
  font-weight: 700;
}

.section-burn-form .bf-burn-details {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px var(--space-md);
  margin: var(--space-md) 0 0;
  font-size: var(--font-sm);
}

.section-burn-form .bf-burn-details dt {
  color: var(--color-muted);
  font-weight: 500;
}
.section-burn-form .bf-burn-details dd {
  margin: 0;
  word-break: break-word;
}

.section-burn-form .bf-burn-notes { white-space: pre-wrap; }

.section-burn-form .bf-burn-gps {
  color: var(--color-primary);
  text-decoration: underline;
}
.section-burn-form .bf-burn-gps.is-empty {
  color: var(--color-muted);
  text-decoration: none;
}

.section-burn-form .bf-burn-actions {
  margin-top: var(--space-md);
  display: flex;
  justify-content: flex-end;
}
.section-burn-form .bf-burn-actions .bf-btn { width: 100%; max-width: 100%; }

@media (min-width: 540px) {
  .section-burn-form .bf-burn-actions .bf-btn { width: auto; }
}

@media (max-width: 540px) {
  .section-burn-form .bf-burn-details {
    grid-template-columns: 1fr;
  }
  .section-burn-form .bf-burn-details dt {
    margin-top: var(--space-xs);
    font-size: var(--font-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
}

/* ─── Status pills ─────────────────────────────────────────────────── */

.section-burn-form .pill-burning,
.section-burn-form .pill-complete,
.section-burn-form .pill-unknown {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex: 0 0 auto;
}

.section-burn-form .pill-burning {
  background: rgba(232, 128, 76, 0.18);
  color: #b65528;
}
.section-burn-form .pill-complete {
  background: #fbecb2;
  color: #8a6e15;
}
.section-burn-form .pill-unknown {
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-muted);
}

/* Used by the admin editor to lay sibling fields side-by-side
 * (e.g. Name + How-to-follow-up at 70/30). Not used by the public
 * form — left here so the styles travel with the form scope. */
.section-burn-form .bf-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}
.section-burn-form .bf-row > .bf-field { min-width: 0; }
@media (max-width: 540px) {
  .section-burn-form .bf-row > .bf-field { flex: 1 1 100% !important; }
}

/* ─── Admin-only extensions ─────────────────────────────────────────
 *
 * The admin editor reuses the form classes above and adds a few extra:
 *   .bf-select         — a native <select> styled to match .bf-input
 *   .bf-checkbox-label — checkbox + label row inside .bf-field--checkbox
 *   .bf-btn--danger    — destructive secondary button (delete)
 *   .bf-meta           — read-only ID/timestamp footer line
 *
 * Defining them under .section-burn-form keeps the styles scoped the
 * same way the rest of the form is — they don't leak out of the
 * editor modal or the public form section. */

.section-burn-form .bf-select {
  appearance: auto;
  -webkit-appearance: auto;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  padding-right: var(--space-md);
}

.section-burn-form .bf-field--checkbox { gap: 0; }

.section-burn-form .bf-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-md);
  cursor: pointer;
  padding: 6px 0;
}

.section-burn-form .bf-checkbox-label input {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}

.section-burn-form .bf-btn--danger {
  background: transparent;
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}
.section-burn-form .bf-btn--danger:hover:not(:disabled) {
  background: var(--color-danger);
  color: #ffffff;
}

.section-burn-form .bf-meta {
  margin: 4px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: var(--font-xs);
  color: var(--color-muted);
  border-top: 1px dashed var(--color-border);
  padding-top: var(--space-sm);
}

.section-burn-form .bf-meta code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--font-xs);
}
