/* Interface própria do Relatório Fotográfico — specs.md §6. A base (barra, botões, layout, campos, segmentado,
   pendências, prévia, avisos e diálogos) vem do kit: ../../compartilhado/css/ui.css. */

/* ---------- Formulário: período e tipo ---------- */
.period { display: flex; align-items: center; gap: 8px; }
.period__pair { display: flex; gap: 4px; flex: 1 1 0; min-width: 0; }
.period__pair select { flex: 1 1 auto; min-width: 0; }
.period__pair input { flex: 0 0 76px; }
.period__sep { color: var(--rf-ink-2); }
#f-periodo-texto { margin-top: 4px; }

/* Tipos: etiquetas do mesmo tamanho, duas por linha */
#f-tipo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
#f-tipo .seg span { display: flex; justify-content: center; width: 100%; height: 100%; text-align: center; white-space: normal; }

/* Área de upload */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
            padding: 18px 12px; border: 1px dashed var(--rf-line); border-radius: 4px; background: var(--rf-muted);
            color: var(--rf-ink-2); cursor: pointer; }
.dropzone strong { color: var(--rf-navy); }
.dropzone__icon { width: 26px; height: 26px; color: var(--rf-navy); }
.dropzone__hint { font-size: 12px; color: var(--rf-ink-3); }
.dropzone.is-over { border-color: var(--rf-cyan); background: rgba(0, 159, 223, .08); }
.progress { font-size: 12px; color: var(--rf-ink-2); margin: 8px 0 0; }

/* Cartões de foto */
.photo-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.photo-card { display: grid; grid-template-columns: 18px 96px minmax(0, 1fr); gap: 10px; align-items: start;
              border: 1px solid var(--rf-line); background: #fff; padding: 8px; }
.photo-card.is-dragging { opacity: .4; }
.photo-card.is-drop-before { box-shadow: 0 -3px 0 var(--rf-cyan); }
.photo-card.is-drop-after { box-shadow: 0 3px 0 var(--rf-cyan); }
.photo-card__handle { cursor: grab; color: var(--rf-ink-3); align-self: center; display: grid; place-items: center; height: 100%; }
.photo-card__handle svg { width: 14px; height: 20px; }
.photo-card__thumb { width: 96px; aspect-ratio: 351 / 340; object-fit: cover; display: block; background: var(--rf-muted); border: 1px solid var(--rf-line); }
.layout-3x2 .photo-card__thumb { aspect-ratio: 230 / 316; }
.photo-card__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.photo-card__head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.photo-card__num { font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--rf-navy); }
.photo-card__tools { display: flex; gap: 2px; }
.photo-card textarea { min-height: 52px; font-size: 13px; }
.photo-card__meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--rf-ink-3); }
.photo-card__meta .is-over { color: var(--ui-warning); font-weight: 600; }
.photo-card.is-missing textarea { border-color: #fdb022; }

/* ---------- Diálogo de exportação ---------- */
.size-plan { font-size: 13px; padding: 10px 12px; background: var(--ui-info-bg); border-radius: 4px; }
.size-plan strong { color: var(--rf-navy); }

/* ---------- Fase 2: cartão de foto ---------- */
.photo-card__thumb-btn { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; }
.photo-card__thumb-btn:focus-visible { outline: none; box-shadow: var(--ui-focus); }
.photo-card__title { display: flex; align-items: center; gap: 6px; }
.photo-card__sel { width: 16px; height: 16px; margin: 0; accent-color: var(--rf-navy); }
.photo-card.is-selected { border-color: var(--rf-navy); background: var(--ui-info-bg); }
.photo-card__meta { align-items: center; }
.photo-card__meta .photo-card__tools { margin-left: -6px; }
.photo-card__count { white-space: nowrap; }
.photo-list-head { display: flex; justify-content: flex-end; margin-top: 8px; }
.batch-bar { position: sticky; top: 0; z-index: 2; margin-top: 8px; padding: 10px; background: #fff;
             border: 1px solid var(--rf-navy); box-shadow: 0 4px 12px rgba(27, 30, 51, .12); }
.batch-bar__label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
                    color: var(--rf-navy); margin-bottom: 6px; }
.batch-bar__row { display: flex; gap: 6px; }
.batch-bar__row input { flex: 1 1 auto; min-width: 0; }
.batch-bar__row--fit { margin-top: 8px; align-items: center; flex-wrap: wrap; }
.batch-bar__hint { font-size: 12px; color: var(--rf-ink-2); }
.crop-fit { margin: 0; }
.crop-frame.is-contain { cursor: default; }

/* ---------- Enquadramento ---------- */
dialog#dlg-enquadrar { width: auto; max-width: calc(100vw - 32px); }

.crop-stage { display: flex; justify-content: center; background: var(--rf-muted); padding: 12px; }
.crop-frame { position: relative; overflow: hidden; border: 1px solid var(--rf-line); background: #fff; cursor: grab;
              touch-action: none; max-width: 100%; }
.crop-frame.is-dragging { cursor: grabbing; }
.crop-frame:focus-visible { outline: none; box-shadow: var(--ui-focus); }
.crop-frame img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; pointer-events: none; }

/* ---------- Anotações (RF-24) ---------- */
.photo-card__thumb.rf-media { width: 96px; aspect-ratio: 351 / 340; border: 1px solid var(--rf-line); }
.layout-3x2 .photo-card__thumb.rf-media { aspect-ratio: 230 / 316; }
.crop-frame > .rf-media { width: 100%; height: 100%; background: #fff; }
.crop-frame img { user-select: none; pointer-events: none; }
dialog#dlg-anotar { width: min(720px, calc(100vw - 32px)); }
.anot-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.anot-toolbar__label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--rf-ink-3); }
.anot-toolbar input[type="text"] { flex: 1 1 200px; width: auto; }
.segmented--sm .seg span { padding: 5px 9px; }
.segmented--sm .seg svg { width: 14px; height: 14px; }
.anot-cores { display: flex; gap: 6px; }
.anot-swatch { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--rf-line); background: var(--cor); cursor: pointer; padding: 0; }
.anot-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--rf-navy); }
.anot-swatch:focus-visible { outline: none; box-shadow: var(--ui-focus); }
.anot-cor-livre { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--rf-ink-2); cursor: pointer; }
.anot-cor-livre input { width: 30px; height: 26px; padding: 0; border: 1px solid var(--rf-line); border-radius: 4px; background: none; cursor: pointer; }
.anot-frame { cursor: crosshair; }
.anot-frame[data-ferramenta="selecionar"] { cursor: default; }
.anot-frame[data-ferramenta="texto"] { cursor: text; }
.anot-frame .rf-media__anot.is-editor { pointer-events: auto; }
.anot-frame [data-anot], .anot-frame .anot-hit { cursor: move; }
.anot-frame .anot-handle { cursor: grab; }

/* ---------- Prévia clicável e alertas (somente na tela) ---------- */
@media screen {
  /* Durante a exportação em PDF direto (.doc-exportando) nada disso aparece */
  #documento .rf-photo { cursor: pointer; }
  #documento:not(.doc-exportando) .rf-photo:hover { outline: 2px solid rgba(0, 159, 223, .5); outline-offset: 1px; }
  #documento:not(.doc-exportando) .rf-photo.is-anot-cut .rf-media { box-shadow: inset 0 0 0 3px #fdb022; }
  #documento:not(.doc-exportando) .rf-photo.is-cut figcaption { background: var(--ui-warning-bg); box-shadow: inset 0 -2px 0 #fdb022; }
}

@media screen and (max-width: 560px) {
  .photo-card { grid-template-columns: 72px minmax(0, 1fr); }
  .photo-card__handle { display: none; }
  .photo-card__thumb { width: 72px; }
}
