/* ═══════════════════════════════════════════════════════
   SegnalaOra — Form segnalazione civica
   CSS estratto da segnalazione-civica.html
   ═══════════════════════════════════════════════════════ */

:root {
  --ink: #1a1208;
  --paper: #f5f0e8;
  --amber: #d4820a;
  --amber-light: #f0a93a;
  --sage: #3d5a47;
  --rust: #c0392b;
  --mist: #e8e2d6;
  --shadow: rgba(26,18,8,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.6;
}

header {
  background: var(--ink);
  color: var(--paper);
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px var(--shadow);
}

.logo-mark {
  width: 38px;
  height: 38px;
  background: var(--amber);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

header h1 {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.header-actions {
  margin-left: auto;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.btn-map-link {
  background: rgba(255,255,255,0.12);
  color: var(--paper);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  font-size: 0.78rem;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-map-link:hover { background: rgba(255,255,255,0.2); }

/* INFO BUTTON */
.btn-info {
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: var(--paper);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  opacity: 0.7;
  transition: opacity 0.2s, border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}
.btn-info:hover { opacity: 1; border-color: var(--amber); color: var(--amber); }

/* INFO MODAL */
.info-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,18,8,0.65);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.info-overlay.open { display: flex; }
.info-modal {
  background: var(--paper);
  color: var(--ink);
  border-radius: 14px;
  max-width: 500px;
  width: 100%;
  padding: 2rem 2rem 1.6rem;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
}
.info-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--ink);
  opacity: 0.45;
  transition: opacity 0.2s;
  line-height: 1;
  padding: 0.2rem 0.4rem;
}
.info-modal-close:hover { opacity: 1; }
.info-modal h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.35rem;
  margin-bottom: 0.8rem;
  color: var(--amber);
}
.info-modal p { font-size: 0.87rem; line-height: 1.65; margin-bottom: 0.7rem; }
.info-modal ol {
  padding-left: 1.3rem;
  font-size: 0.87rem;
  line-height: 1.75;
  margin-bottom: 0.7rem;
}
.info-modal .credits {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--mist);
  font-size: 0.78rem;
  color: #777;
  line-height: 1.7;
}
.info-modal .credits strong { color: var(--ink); }
.info-modal .credits a { color: var(--amber); text-decoration: none; }
.info-modal .credits a:hover { text-decoration: underline; }

.steps-bar {
  background: var(--mist);
  border-bottom: 1px solid rgba(26,18,8,0.1);
  padding: 0.8rem 2rem;
  display: flex;
  gap: 0;
  overflow-x: auto;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #8a7f70;
  white-space: nowrap;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  transition: all 0.3s;
}

.step.active { background: var(--amber); color: white; }
.step.done { color: var(--sage); }

.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: currentColor;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.7;
}

.step.active .step-num { background: white; color: var(--amber); opacity: 1; }
.step-arrow { color: #c5bcad; margin: 0 0.2rem; font-size: 0.7rem; }

main {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.section-card {
  background: white;
  border-radius: 16px;
  border: 1px solid rgba(26,18,8,0.08);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 12px var(--shadow);
  display: none;
  animation: slideIn 0.4s ease;
}

.section-card.visible { display: block; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-header {
  background: var(--ink);
  color: var(--paper);
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.card-header .icon { font-size: 1.4rem; }

.card-header h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 600;
}

.card-header p {
  font-size: 0.78rem;
  color: #a8a090;
  font-weight: 300;
  margin-top: 0.1rem;
}

.card-body { padding: 1.5rem; }

/* PHOTO */
.photo-zone {
  border: 2px dashed rgba(26,18,8,0.15);
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.photo-zone:hover { border-color: var(--amber); background: rgba(212,130,10,0.03); }
.photo-zone input { display: none; }
.photo-zone .big-icon { font-size: 2.5rem; margin-bottom: 0.8rem; display: block; }

.photo-zone h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.photo-zone p { font-size: 0.82rem; color: #8a7f70; }

.photo-preview { display: none; position: relative; }

.photo-preview img {
  width: 100%;
  border-radius: 10px;
  max-height: 280px;
  object-fit: cover;
}

.photo-preview .change-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(26,18,8,0.7);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  backdrop-filter: blur(4px);
}

.photo-info {
  margin-top: 0.8rem;
  padding: 0.6rem 0.9rem;
  background: rgba(61,90,71,0.08);
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--sage);
  display: none;
}

.photo-info.visible { display: flex; align-items: center; gap: 0.5rem; }

.btn-row {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

.btn-sm {
  flex: 1;
  min-width: 120px;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1.5px solid rgba(26,18,8,0.15);
  background: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.btn-sm:hover { border-color: var(--amber); color: var(--amber); }

.btn-sm.primary { background: var(--amber); border-color: var(--amber); color: white; }
.btn-sm.primary:hover { background: #b8700a; border-color: #b8700a; color: white; }

/* MAP */
#map { height: 320px; border-radius: 10px; overflow: hidden; margin-bottom: 1rem; border: 1px solid rgba(26,18,8,0.1); }

.geo-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  background: rgba(61,90,71,0.08);
  color: var(--sage);
  margin-bottom: 1rem;
}

.geo-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* FORM */
label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: #5a5040;
  margin-bottom: 0.4rem;
  margin-top: 1rem;
}

label:first-child { margin-top: 0; }

select, input[type="text"], input[type="email"], textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid rgba(26,18,8,0.15);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.2s;
  appearance: none;
}

select:focus, input[type="text"]:focus, input[type="email"]:focus, textarea:focus {
  outline: none;
  border-color: var(--amber);
  background: white;
}

input.invalid, textarea.invalid {
  border-color: var(--rust) !important;
  background: #fff5f5;
}

.field-error {
  font-size: 0.78rem;
  color: var(--rust);
  margin-top: 0.25rem;
  display: none;
}

.field-error.visible { display: block; }

.field-error.ok {
  display: block;
  color: var(--sage);
}

input.valid {
  border-color: var(--sage) !important;
  background: #f0fff4;
}

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

.select-wrap { position: relative; }
.select-wrap::after {
  content: '▾';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #8a7f70;
  font-size: 0.9rem;
}

/* AREA INFO CARD */
.area-info {
  display: none;
  background: rgba(212,130,10,0.05);
  border: 1px solid rgba(212,130,10,0.25);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.5;
}
.area-info.visible { display: block; }

.ai-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
  align-items: flex-start;
}
.ai-ico {
  flex-shrink: 0;
  width: 1.4rem;
  font-style: normal;
}
.ai-pec {
  font-size: 0.72rem;
  color: #8a7f70;
  word-break: break-all;
}

/* SEZIONE CC */
.cc-section { margin-top: 1.1rem; }

.cc-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #5a5040;
  margin-bottom: 0.4rem;
  margin-top: 0;
  display: block;
}

.cc-add-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.cc-add-row .select-wrap { flex: 1; min-width: 0; }

.btn-add-cc {
  flex-shrink: 0;
  padding: 0.55rem 0.9rem;
  background: var(--sage);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.btn-add-cc:hover { background: #2d4435; }

.cc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.cc-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(61,90,71,0.09);
  border: 1px solid rgba(61,90,71,0.22);
  border-radius: 6px;
  padding: 0.2rem 0.4rem 0.2rem 0.65rem;
  font-size: 0.74rem;
  color: var(--sage);
  max-width: 100%;
}
.cc-tag button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sage);
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.1rem;
  opacity: 0.55;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.cc-tag button:hover { opacity: 1; }

/* DESTINATARI */
.recipient-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.recipient-item {
  border: 1.5px solid rgba(26,18,8,0.12);
  border-radius: 10px;
  padding: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  user-select: none;
}

.recipient-item:hover { border-color: var(--amber-light); }

.recipient-item.selected {
  border-color: var(--amber);
  background: rgba(212,130,10,0.06);
}

.recipient-item .ri-icon { font-size: 1.4rem; flex-shrink: 0; }
.recipient-item .ri-name { font-size: 0.78rem; font-weight: 600; }
.recipient-item .ri-sub { font-size: 0.7rem; color: #8a7f70; }
.recipient-item input[type="checkbox"] { display: none; }

/* ANTEPRIMA */
.preview-box {
  background: var(--mist);
  border-radius: 10px;
  padding: 1.2rem;
  font-size: 0.85rem;
  line-height: 1.6;
  border-left: 3px solid var(--amber);
  color: #3a3020;
  word-break: break-word;
}

/* BOTTONI INVIO */
.send-btn {
  width: 100%;
  padding: 1rem;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 12px;
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.25s;
  letter-spacing: -0.01em;
  margin-top: 1rem;
}

.send-btn:hover {
  background: var(--amber);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212,130,10,0.3);
}

.send-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* SUCCESSO */
.success-card {
  text-align: center;
  padding: 3rem 2rem;
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
  animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.success-card h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.success-card p { color: #8a7f70; font-size: 0.9rem; max-width: 360px; margin: 0 auto 1rem; }

.tag-id {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-family: monospace;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.channels-sent {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.channel-badge {
  background: var(--mist);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* NOTA CONFIG */
.config-notice {
  background: #fff8e1;
  border: 1.5px solid #ffd54f;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  color: #5a4000;
}

.config-notice strong { display: block; margin-bottom: 0.3rem; font-size: 0.85rem; }

/* NAV */
.nav-next { display: flex; justify-content: flex-end; margin-top: 1.2rem; }

.btn-next {
  padding: 0.8rem 1.8rem;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.btn-next:hover { background: var(--amber); }

/* WARN BANNER (success card) */
.warn-banner {
  background: #fff8e1;
  border: 1.5px solid #f4c542;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
  color: #6a4f00;
  margin-bottom: 0.75rem;
  line-height: 1.5;
  text-align: left;
}

/* EXIF BANNER (step 2) */
.exif-banner {
  background: #fff8e1;
  border: 1.5px solid #f4c542;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-size: 0.82rem;
  color: #6a4f00;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.exif-banner-btn {
  display: block;
  margin-top: 0.5rem;
  background: none;
  border: 1.5px solid #c8a800;
  border-radius: 8px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: #6a4f00;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
}
.exif-banner-btn:hover { background: #fff0a0; }

/* TOKEN ROW (success card) */
.token-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: rgba(61,90,71,0.07);
  border: 1px solid rgba(61,90,71,0.2);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
}

.token-label { color: #6a7f70; font-weight: 500; }

.token-val {
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--ink);
  word-break: break-all;
}

.copy-btn-small {
  background: none;
  border: 1px solid rgba(26,18,8,0.2);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  flex-shrink: 0;
}

.token-hint {
  font-size: 0.75rem;
  color: #9a8f80;
  text-align: center;
  margin-bottom: 0.75rem;
}

/* COPY REMINDER */
.copy-reminder {
  display: none;
  background: #fff8e1;
  border: 1.5px solid #f4c542;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
  color: #7a5f00;
  text-align: center;
  margin: 0.75rem 0;
  gap: 0.5rem;
}

.copy-reminder.visible { display: block; }

.copy-reminder-close {
  display: block;
  margin: 0.4rem auto 0;
  background: none;
  border: 1px solid #c8a800;
  border-radius: 6px;
  padding: 0.2rem 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
  color: #7a5f00;
  font-family: 'DM Sans', sans-serif;
}

/* FIELD HINT */
.field-hint {
  display: block;
  font-size: 0.76rem;
  color: #9a8f80;
  margin-top: 0.3rem;
}

.cat-hint {
  display: block;
  font-size: 0.76rem;
  color: var(--amber);
  margin-top: 0.3rem;
  min-height: 1.1em;
}

@media (max-width: 480px) {
  main { padding: 1rem; }
  .recipient-grid { grid-template-columns: 1fr; }
  header h1 { font-size: 1.1rem; }
}
