/* ═══════════════════════════════════════════════════════════════════════════
   reporte.danoral.com — Estilos
   Paleta: #59598f (primario), #3d3b6e (oscuro), #f2f5f5 (fondo)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --d-primary:       #59598f;
  --d-primary-dark:  #3d3b6e;
  --d-primary-light: #7b7bb5;
  --d-accent:        #e65100;
  --d-bg:            #f2f5f5;
  --d-surface:       #ffffff;
  --d-border:        #e0e3e8;
  --d-text:          #1C212D;
  --d-text-sec:      #5f6878;
  --d-text-muted:    #9aa3b0;
  --d-error:         #ba1a1a;
  --d-success:       #2e7d32;
  --d-warning:       #e65100;
  --d-radius:        10px;
  --d-shadow:        0 2px 12px rgba(0,0,0,.08);
  --d-shadow-lg:     0 8px 32px rgba(0,0,0,.12);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0; padding: 0;
  font-family: 'Roboto', 'Segoe UI', sans-serif;
  background: var(--d-bg);
  color: var(--d-text);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--d-primary-dark);
  color: #fff;
  padding: 0 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; gap: 1rem;
}
.logo-block {
  display: flex; flex-direction: column; line-height: 1;
}
.logo-administradora {
  color: rgba(255,255,255,.65);
  font-size: .65rem; letter-spacing: 1px; font-family: Arial;
  text-transform: uppercase;
}
.logo-danoral {
  color: #fff;
  font-size: 1.4rem; font-weight: bold; font-style: italic;
  font-family: Arial; letter-spacing: .5px;
}
.header-badge {
  display: flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px; padding: .3rem .9rem;
  font-size: .78rem; color: rgba(255,255,255,.9);
  white-space: nowrap;
}
.badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ff6b6b;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform: scale(1); }
  50%      { opacity:.6; transform: scale(1.3); }
}

/* ── Hero ───────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--d-primary-dark) 0%, var(--d-primary) 60%, var(--d-primary-light) 100%);
  color: #fff;
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}
.hero-inner { max-width: 700px; margin: 0 auto; }
.hero-icon { font-size: 3rem; margin-bottom: .75rem; }
.hero-title {
  font-size: 2rem; font-weight: 700;
  margin: 0 0 .75rem; line-height: 1.2;
}
.hero-subtitle {
  font-size: 1.05rem; color: rgba(255,255,255,.85);
  margin: 0 0 2rem;
}
.hero-steps {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: .5rem;
}
.step {
  display: flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.12);
  border-radius: 8px; padding: .5rem .9rem;
  font-size: .85rem;
}
.step-num {
  background: #fff; color: var(--d-primary-dark);
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; flex-shrink: 0;
}
.step-arrow { color: rgba(255,255,255,.5); font-size: 1.2rem; }

/* ── Main ───────────────────────────────────────────────────────────────────── */
.main-content {
  max-width: 820px; margin: 0 auto;
  padding: 2rem 1rem 4rem;
  display: flex; flex-direction: column; gap: 1.5rem;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--d-surface);
  border-radius: var(--d-radius);
  box-shadow: var(--d-shadow);
  padding: 1.75rem;
  border: 1px solid var(--d-border);
}
.step-card { transition: opacity .3s, transform .3s; }
.step-card.hidden { display: none; }

.card-header {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--d-border);
}
.card-header h2 { margin: 0; font-size: 1.2rem; flex: 1; }
.card-icon { width: 22px; height: 22px; color: var(--d-primary); flex-shrink: 0; }

/* ── Tabs ───────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: .5rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--d-border);
}
.tab {
  background: none; border: none; cursor: pointer;
  padding: .6rem 1.1rem; font-size: .9rem; color: var(--d-text-sec);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all .2s; border-radius: 6px 6px 0 0;
}
.tab:hover { color: var(--d-primary); }
.tab.active { color: var(--d-primary); border-bottom-color: var(--d-primary); font-weight: 500; }
.tab-content.hidden { display: none; }

/* ── Inputs ─────────────────────────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--d-border);
  border-radius: var(--d-radius);
  font-size: .95rem;
  font-family: inherit;
  color: var(--d-text);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.input:focus {
  border-color: var(--d-primary);
  box-shadow: 0 0 0 3px rgba(89,89,143,.15);
}
.textarea { resize: vertical; min-height: 120px; }

.input-row {
  display: flex; gap: .75rem; align-items: flex-start;
}
.input-row .input { flex: 1; }

.select-group { margin-bottom: 1rem; }
.select-group label { display: block; font-size: .85rem; color: var(--d-text-sec); margin-bottom: .35rem; font-weight: 500; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.25rem;
  border-radius: var(--d-radius);
  border: none; cursor: pointer;
  font-size: .95rem; font-family: inherit;
  font-weight: 500; transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--d-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--d-primary-dark); transform: translateY(-1px); }
.btn-primary:active { transform: none; }
.btn-outline {
  background: #fff; color: var(--d-primary);
  border: 1.5px solid var(--d-primary);
}
.btn-outline:hover { background: rgba(89,89,143,.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

.btn-enviar {
  background: linear-gradient(135deg, var(--d-primary), var(--d-primary-dark));
  color: #fff;
  padding: .9rem 2rem;
  font-size: 1.05rem;
  border-radius: 30px;
  box-shadow: 0 4px 16px rgba(89,89,143,.35);
}
.btn-enviar:hover {
  box-shadow: 0 6px 24px rgba(89,89,143,.45);
  transform: translateY(-2px);
}

/* ── Hints y etiquetas ──────────────────────────────────────────────────────── */
.hint { font-size: .85rem; color: var(--d-text-muted); margin: 0 0 .75rem; }
.section-title {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 600; font-size: .95rem;
  color: var(--d-primary-dark);
  margin: 1.5rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--d-border);
}
.section-title svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Gravedad ───────────────────────────────────────────────────────────────── */
.gravedad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
  margin-bottom: .5rem;
}
.gravedad-option {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: .25rem;
  padding: .9rem .5rem;
  border: 2px solid var(--d-border);
  border-radius: var(--d-radius);
  cursor: pointer;
  transition: all .2s;
  user-select: none;
}
.gravedad-option input { display: none; }
.gravedad-option:hover { border-color: var(--d-primary-light); background: rgba(89,89,143,.04); }
.gravedad-option:has(input:checked) {
  border-color: var(--d-primary);
  background: rgba(89,89,143,.08);
  box-shadow: 0 0 0 2px rgba(89,89,143,.2);
}
.gravedad-option.critico:has(input:checked) { border-color: #ba1a1a; background: #fff5f5; }
.gravedad-option.grave:has(input:checked)   { border-color: #e65100; background: #fff8f5; }
.gravedad-option.moderado:has(input:checked){ border-color: #f9a825; background: #fffde7; }
.gravedad-option.leve:has(input:checked)    { border-color: #558b2f; background: #f1f8e9; }
.gravedad-option.sin_danos:has(input:checked){ border-color: #2e7d32; background: #e8f5e9; }

.gravedad-icon { font-size: 1.8rem; }
.gravedad-label { font-weight: 600; font-size: .9rem; }
.gravedad-desc  { font-size: .72rem; color: var(--d-text-muted); line-height: 1.3; }

/* ── Checkboxes de daños ────────────────────────────────────────────────────── */
.danos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: .5rem;
  margin-bottom: .75rem;
}
.dano-check {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .9rem;
  border: 1.5px solid var(--d-border);
  border-radius: 8px;
  cursor: pointer;
  font-size: .9rem;
  transition: all .2s;
}
.dano-check svg { width: 16px; height: 16px; color: var(--d-primary); flex-shrink: 0; }
.dano-check input { margin: 0; accent-color: var(--d-primary); }
.dano-check:hover { border-color: var(--d-primary-light); background: rgba(89,89,143,.04); }
.dano-check:has(input:checked) {
  border-color: var(--d-primary);
  background: rgba(89,89,143,.08);
  font-weight: 500;
}

/* ── Upload zone ────────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--d-primary-light);
  border-radius: var(--d-radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: rgba(89,89,143,.03);
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--d-primary);
  background: rgba(89,89,143,.07);
}
.upload-zone p { margin: 0; }

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}
.preview-item {
  position: relative; border-radius: 8px; overflow: hidden;
  border: 1.5px solid var(--d-border);
  aspect-ratio: 1;
  background: var(--d-bg);
  display: flex; align-items: center; justify-content: center;
}
.preview-item img {
  width: 100%; height: 100%; object-fit: cover;
}
.preview-item .preview-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: .65rem; padding: .2rem .4rem;
  text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
}
.preview-item .preview-remove {
  position: absolute; top: 3px; right: 3px;
  background: rgba(186,26,26,.85); color: #fff;
  border: none; border-radius: 50%; width: 20px; height: 20px;
  cursor: pointer; font-size: .75rem; display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.preview-doc {
  flex-direction: column; gap: .3rem;
  font-size: .7rem; text-align: center; color: var(--d-text-sec);
  padding: .5rem;
}

/* ── Form grid ──────────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.form-group { display: flex; flex-direction: column; gap: .3rem; }
.form-group label { font-size: .85rem; color: var(--d-text-sec); font-weight: 500; }
.form-group-full { grid-column: 1 / -1; }

/* ── Progreso ───────────────────────────────────────────────────────────────── */
.upload-progress { margin-top: 1rem; }
.progress-bar {
  height: 8px; background: var(--d-bg);
  border-radius: 10px; overflow: hidden; margin-bottom: .5rem;
}
.progress-fill {
  height: 100%; background: var(--d-primary);
  border-radius: 10px; transition: width .3s;
  width: 0%;
}
.upload-progress p { font-size: .85rem; color: var(--d-text-sec); margin: 0; text-align: center; }

/* ── Form actions ───────────────────────────────────────────────────────────── */
.form-actions { margin-top: 2rem; text-align: center; }
.privacy-note {
  display: flex; align-items: center; justify-content: center; gap: .3rem;
  font-size: .78rem; color: var(--d-text-muted); margin-top: .75rem;
}

/* ── Resultado cod ──────────────────────────────────────────────────────────── */
.result-box {
  margin-top: .75rem; padding: .9rem 1rem;
  border-radius: var(--d-radius); font-size: .9rem;
}
.result-box.ok { background: #e8f5e9; border: 1px solid #a5d6a7; color: var(--d-success); }
.result-box.err { background: #ffebee; border: 1px solid #ef9a9a; color: var(--d-error); }

/* ── Apto badge ─────────────────────────────────────────────────────────────── */
.apto-badge {
  background: var(--d-primary);
  color: #fff; border-radius: 20px;
  padding: .25rem .85rem; font-size: .82rem;
  white-space: nowrap;
}

/* ── Confirmación ───────────────────────────────────────────────────────────── */
.success-block { text-align: center; padding: 1rem 0; }
.success-icon { font-size: 4rem; margin-bottom: 1rem; }
.success-block h2 { color: var(--d-success); font-size: 1.5rem; margin: 0 0 .75rem; }
.success-block p { color: var(--d-text-sec); max-width: 500px; margin: 0 auto 1.5rem; }
.conf-detalles {
  background: var(--d-bg); border-radius: var(--d-radius);
  padding: 1rem; max-width: 400px; margin: 0 auto 1.5rem;
  text-align: left; font-size: .9rem;
}
.conf-detalles strong { color: var(--d-primary-dark); }
.conf-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Toast ──────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: #323232; color: #fff;
  padding: .75rem 1.5rem; border-radius: 8px;
  font-size: .9rem; z-index: 1000;
  box-shadow: var(--d-shadow-lg);
  transition: opacity .3s;
  max-width: 90vw; text-align: center;
}
.toast.hidden { display: none; }
.toast.success { background: var(--d-success); }
.toast.error   { background: var(--d-error); }

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--d-primary-dark);
  color: rgba(255,255,255,.7);
  text-align: center; padding: 1.5rem;
}
.footer-inner { max-width: 600px; margin: 0 auto; }
.site-footer p { margin: .25rem 0; font-size: .82rem; }
.site-footer a { color: rgba(255,255,255,.85); }
.footer-inner .logo-administradora { color: rgba(255,255,255,.5); }
.footer-inner .logo-danoral { color: rgba(255,255,255,.9); }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero-title { font-size: 1.4rem; }
  .hero-steps { flex-direction: column; }
  .step-arrow { transform: rotate(90deg); }
  .form-grid  { grid-template-columns: 1fr; }
  .gravedad-grid { grid-template-columns: 1fr 1fr; }
  .header-badge { display: none; }
  .card { padding: 1.25rem; }
  .input-row { flex-direction: column; }
  .conf-actions { flex-direction: column; align-items: center; }
}


/* ── Dirección / Nominatim / Leaflet ───────────────────────────────────── */
.address-block { display:flex; flex-direction:column; gap:.65rem; }

.address-input-row {
  display:flex; gap:.6rem; align-items:flex-start;
}
.address-input-row > div { flex:1; position:relative; }

.btn-geo {
  background:#fff; color:var(--d-primary);
  border:1.5px solid var(--d-primary);
  border-radius:var(--d-radius);
  padding:.62rem .9rem;
  cursor:pointer; white-space:nowrap;
  display:flex; align-items:center; gap:.4rem;
  font-size:.88rem; font-family:inherit; font-weight:500;
  transition:all .2s; flex-shrink:0;
}
.btn-geo:hover { background:rgba(89,89,143,.08); }
.btn-geo svg { width:16px; height:16px; }

/* Nominatim dropdown */
.nominatim-dropdown {
  position:absolute; top:100%; left:0; right:0; z-index:300;
  background:#fff;
  border:1.5px solid var(--d-primary);
  border-top:none;
  border-radius:0 0 var(--d-radius) var(--d-radius);
  box-shadow:var(--d-shadow-lg);
  max-height:220px; overflow-y:auto;
}
.nominatim-dropdown.hidden { display:none; }
.nom-item {
  padding:.55rem .85rem;
  font-size:.83rem; cursor:pointer;
  border-bottom:1px solid var(--d-border);
  line-height:1.4;
}
.nom-item:last-child { border-bottom:none; }
.nom-item:hover { background:rgba(89,89,143,.07); }
.nom-empty { color:var(--d-text-muted); cursor:default; }

/* Edificio lista dropdown (tab lista) */
.edif-lista {
  border:1.5px solid var(--d-primary);
  border-radius:var(--d-radius);
  background:#fff; max-height:220px; overflow-y:auto;
  margin-top:.35rem;
  box-shadow:var(--d-shadow);
}
.edif-lista.hidden { display:none; }
.edif-item {
  padding:.55rem .85rem; font-size:.88rem;
  cursor:pointer; border-bottom:1px solid var(--d-border);
}
.edif-item:last-child { border-bottom:none; }
.edif-item:hover { background:rgba(89,89,143,.07); color:var(--d-primary-dark); font-weight:500; }
.edif-empty { color:var(--d-text-muted); cursor:default; }

/* Estado geolocalización */
.geo-status {
  font-size:.83rem; padding:.45rem .75rem;
  border-radius:6px; margin-top:-.2rem;
}
.geo-info { background:#e3f2fd; color:#1565c0; }
.geo-ok   { background:#e8f5e9; color:#2e7d32; }
.geo-err  { background:#ffebee; color:#ba1a1a; }

/* Mini mapa Leaflet */
.mapa-mini {
  border-radius:var(--d-radius);
  overflow:hidden;
  border:1.5px solid var(--d-border);
}
#map-container { width:100%; height:220px; }

/* Tags */
.optional-tag {
  font-size:.72rem; font-weight:400;
  background:var(--d-bg); color:var(--d-text-muted);
  border-radius:4px; padding:.1rem .4rem; margin-left:.35rem;
}
.required-tag { color:var(--d-error); font-size:.85rem; margin-left:.2rem; }

@media(max-width:520px) {
  .address-input-row { flex-direction:column; }
  .btn-geo { width:100%; justify-content:center; }
  #map-container { height:175px; }
}
