/*CidadeOrganizada/css/style.css */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f4f4;
}

body {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

button,
textarea,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

#map {
  width: 100%;
  height: 100%;
}

.topbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.topbar__left h1 {
  margin: 0;
  font-size: 20px;
  color: #222;
}

.topbar__left p {
  margin: 4px 0 0;
  font-size: 14px;
  color: #666;
}

.count-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: #f8dfe3;
  color: #a90e27;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.camera-wrap {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 1000;
}

.camera-btn {
  width: 80px;
  height: 80px;

  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(1px);
  border: 2px solid rgba(0,0,0,0.2);

  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.30);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: transform 0.18s ease;
}

.camera-btn:hover {
  transform: scale(1.03);
}

.camera-btn__icon {
  width: 36px;
  height: 36px;
  opacity: 0.9;
}

.camera-btn:active {
  transform: scale(0.95);
}

.camera-btn__text {
  font-size: 12px;
  font-weight: 700;
}

.gps-status {
  position: absolute;
  left: 50%;
  bottom: 130px;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 12px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.46);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 18px;
  box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.24);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal__header h2 {
  margin: 0;
  font-size: 22px;
  color: #222;
}

.modal__subtitle {
  margin: 10px 0 16px;
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

.icon-close {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: #f0f0f0;
  cursor: pointer;
  font-size: 16px;
}

.preview {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 16px;
  border: none;
  background: #f0f0f0;
  margin-bottom: 18px;
  display: block;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #333;
}

.field textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid #d8d8d8;
  border-radius: 14px;
  padding: 12px;
  font-size: 14px;
  outline: none;
}

.coords-box {
  padding: 12px;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  background: #fafafa;
  font-size: 13px;
  color: #444;
  line-height: 1.5;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn {
  flex: 1;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn--secondary {
  background: #ededed;
  color: #333;
}

.btn--primary {
  background: #b10021;
  color: #fff;
}

.popup-card {
  width: 240px;
}

.popup-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 10px;
  background: #eee;
}

.popup-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #222;
}

.popup-card p {
  margin: 0 0 6px;
  font-size: 12px;
  color: #555;
  line-height: 1.45;
  word-break: break-word;
}

.leaflet-popup-content-wrapper {
  border-radius: 16px;
}

.leaflet-popup-content {
  margin: 12px 14px;
}

/* zoom menor */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12) !important;
  overflow: hidden;
  border-radius: 12px !important;
}

.leaflet-control-zoom a {
  width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
  font-size: 18px !important;
}

@media (max-width: 640px) {
  .topbar {
    padding: 12px 14px;
    gap: 10px;
  }

  .topbar__left h1 {
    font-size: 17px;
  }

  .topbar__left p,
  .count-pill {
    font-size: 12px;
  }


}
/* ── Cluster ──────────────────────────────────────────────────────────────── */
.cluster-icon {
  width: 40px;
  height: 40px;
  background: #b10021;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(177, 0, 33, 0.45);
}

/* ── Modal dois passos ────────────────────────────────────────────────────── */
.modal-step {
  /* nenhuma regra extra necessária — hidden é suficiente */
}

.actions--single {
  margin-top: 14px;
}

/* Preview do tipo selecionado */
.selected-type-preview {
  display: flex;
  justify-content: center;
  padding: 20px 0 16px;
}

.selected-type-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff0f3;
  border: 2px solid #f8c0cb;
  border-radius: 18px;
  padding: 12px 22px;
}

.selected-type-emoji {
  font-size: 32px;
  line-height: 1;
}

.selected-type-label {
  font-size: 22px;
  font-weight: 800;
  color: #b10021;
  letter-spacing: -0.5px;
}

/* ── Seletor de categoria ─────────────────────────────────────────────────── */
.label-optional {
  font-weight: 400;
  color: #aaa;
  font-size: 12px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 4px;
  border: 2px solid #e8e8e8;
  border-radius: 14px;
  background: #fafafa;
  cursor: pointer;
  font-size: 22px;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.cat-btn span {
  font-size: 10px;
  font-weight: 600;
  color: #555;
  line-height: 1.2;
  text-align: center;
}

.cat-btn:hover {
  border-color: #ccc;
  background: #f0f0f0;
}

.cat-btn--active {
  border-color: #b10021;
  background: #fff0f3;
}

.cat-btn--active span {
  color: #b10021;
}

/* ── Popup estilizado ────────────────────────────────────────────────────── */
.avaria-popup .leaflet-popup-content-wrapper {
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  border: none;
}

.avaria-popup .leaflet-popup-content {
  margin: 0;
  width: 260px !important;
}

.avaria-popup .leaflet-popup-tip-container {
  margin-top: -1px;
}

.popup-card {
  width: 260px;
}

.popup-photo {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: #eee;
  cursor: zoom-in;
  transition: opacity 0.15s;
}

.popup-photo:hover {
  opacity: 0.92;
}

.popup-body {
  padding: 10px 14px 8px;
}

.popup-tag {
  display: inline-block;
  background: #fff0f3;
  color: #b10021;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}

.popup-desc {
  margin: 0 0 6px;
  font-size: 13px;
  color: #333;
  line-height: 1.4;
  word-break: break-word;
}

.popup-meta {
  margin: 0 0 3px;
  font-size: 11px;
  color: #888;
  line-height: 1.4;
}

/* Navegação dentro do popup */
.popup-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 12px;
  border-top: 1px solid #f0f0f0;
  gap: 8px;
}

.popup-nav-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #f0f0f0;
  color: #333;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.popup-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.popup-nav-btn:not(:disabled):hover {
  background: #e0e0e0;
}

.popup-nav-counter {
  font-size: 12px;
  color: #999;
  font-weight: 600;
  text-align: center;
  flex: 1;
}

/* ── Lightbox ─────────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.25);
}

/* ── Confirmacao coletiva ─────────────────────────────────────────────────── */
.confirm-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  border: none;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.confirm-btn:hover {
  background: #f0f0f0;
}

.confirm-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.confirm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-top: 1px solid #f0f0f0;
  background: #f6fff6;
}

.confirm-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.confirm-label {
  font-size: 12px;
  font-weight: 600;
  color: #444;
  flex: 1;
}

.confirm-row .confirm-label {
  color: #2a7a2a;
}

.confirm-count {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
}

/* ── Confirmação coletiva ─────────────────────────────────────────────────── */
.confirm-btn,
.confirm-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #f0f0f0;
  font-size: 13px;
  cursor: pointer;
}

.confirm-btn {
  border: none;
  background: #fafafa;
  text-align: left;
  transition: background 0.15s;
}

.confirm-btn:hover {
  background: #f0f0f0;
}

.confirm-row.confirmed {
  background: #f0faf3;
  cursor: default;
}

.confirm-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.confirm-label {
  flex: 1;
  font-weight: 600;
  color: #333;
}

.confirm-row.confirmed .confirm-label {
  color: #1a7a3a;
}

.confirm-count {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
}