/* === FC UX Base (cole no <head> ou no CSS global) === */
:root {
  --fc-brand: #166534;
  --fc-brand-2: #0b3a1d;
  --fc-bg: #0f172a;
  --fc-muted: #64748b;
  --fc-danger: #b91c1c;
  --fc-ok: #065f46;
  --fc-warn: #a16207;
  --fc-surf: #f8fafc;
  --fc-rad: 14px;
  --fc-pad: 14px;
  --fc-gap: 12px;
  --fc-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  --fc-fz: 15px;
  --fc-fz-sm: 13px;
  --fc-fz-lg: 16px;
}

* {
  box-sizing: border-box
}

/* CRÍTICO: NÃO aplicar color em html/body */
html,
body {
  height: 100%;
  background: var(--fc-bg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  font-size: var(--fc-fz);
}

/* Botões icônicos com resposta imediata */
.fc-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #0b3a1d;
  color: #fff;
  border: none;
  outline: none;
  cursor: pointer;
  transition: transform .06s ease, background .2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.fc-icon-btn:is(:focus-visible, :active) {
  transform: scale(.98);
  outline: 2px solid #9ae6b4;
  outline-offset: 2px;
}

.fc-icon-btn[disabled] {
  opacity: .5;
  pointer-events: none
}

/* Feedback "busy" */
.fc-busy {
  position: relative
}

.fc-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .15), transparent);
  animation: fc-shine 1s linear infinite;
}

@keyframes fc-shine {
  from {
    background-position: -200% 0
  }

  to {
    background-position: 200% 0
  }
}

/* Overlay de modal */
.fc-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  background: rgba(15, 23, 42, .6);
  backdrop-filter: saturate(1.1) blur(3px);
}

.fc-modal.is-open {
  display: block
}

.fc-modal__sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  max-height: calc(100dvh - 10px);
  box-shadow: var(--fc-shadow);
  transform: translateY(8%);
  transition: transform .18s ease;
  display: flex;
  flex-direction: column;
}

.fc-modal.is-open .fc-modal__sheet {
  transform: translateY(0)
}

.fc-modal__header {
  position: sticky;
  top: 0;
  background: #fff;
  padding: 16px;
  border-bottom: 1px solid #e2e8f0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fc-modal__title {
  font-weight: 700;
  font-size: 18px;
  color: #0f172a;
  flex: 1
}

.fc-modal__body {
  padding: 12px 16px 100px 16px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.fc-modal__footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

/* Formulários */
.fc-form {
  display: grid;
  gap: var(--fc-gap)
}

.fc-field {
  display: grid;
  gap: 6px
}

.fc-label {
  font-weight: 600;
  color: #1f2937
}

.fc-req {
  color: var(--fc-danger)
}

.fc-input,
.fc-select,
.fc-textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 12px;
  background: #fff;
  color: #0f172a;
  font-size: var(--fc-fz);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.fc-textarea {
  min-height: 90px;
  resize: vertical
}

.fc-input:focus,
.fc-select:focus,
.fc-textarea:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .15)
}

.fc-help {
  font-size: var(--fc-fz-sm);
  color: var(--fc-muted)
}

.fc-error {
  font-size: var(--fc-fz-sm);
  color: var(--fc-danger)
}

.fc-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap
}

.fc-col {
  flex: 1 1 180px
}

/* Botões primários/ secundários */
.fc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  color: #fff;
  background: #166534;
  transition: filter .15s ease, transform .05s ease;
  touch-action: manipulation;
}

.fc-btn:active {
  transform: translateY(1px)
}

.fc-btn[disabled] {
  opacity: .6;
  pointer-events: none
}

.fc-btn--sec {
  background: #0e7490
}

.fc-btn--muted {
  background: #e2e8f0;
  color: #111827
}

.fc-btn--danger {
  background: #b91c1c
}

.fc-chip {
  font-size: 12px;
  padding: 2px 8px;
  background: #ecfeff;
  color: #0e7490;
  border-radius: 999px;
}

/* Lista de espécies – toolbar */
.fc-toolbar {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: #052e16;
  border-bottom: 1px solid rgba(255, 255, 255, .08)
}

.fc-toolbar .fc-icon-btn {
  background: #166534
}

.fc-toolbar .fc-icon-btn:active {
  transform: scale(.97)
}

/* Bloqueio de scroll do body quando modal aberto */
body.fc-lock {
  overflow: hidden;
  touch-action: none
}

/* Acessibilidade foco visível */
:focus-visible {
  outline: 2px solid #16a34a;
  outline-offset: 2px
}