:root {
  --verde: #00746b;
  --verde-oscuro: #07534e;
  --menta: #e3f4ef;
  --linea: #d8e5e1;
  --texto: #202b2a;
  --texto-suave: #52615f;
  --fondo: #f3f7f6;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  color: var(--texto);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--fondo);
  font-size: 16px;
  line-height: 1.5;
}

.wrap {
  max-width: 1080px;
  margin: 28px auto;
  padding: 0 20px;
}

/* Cabecera ---------------------------------------------------------- */

.cabecera {
  display: flex;
  align-items: center;
  gap: 24px;
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: 12px;
  padding: 17px 22px;
  margin-bottom: 18px;
  box-shadow: 0 3px 12px #123b5d0a;
}

.marca {
  display: flex;
  flex: 0 0 auto;
}

.marca img,
.marca-cgate img {
  height: 76px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
}

.marca-cgate {
  margin-left: auto;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.titular {
  flex: 1 1 auto;
  min-width: 0;
  border-left: 1px solid var(--linea);
  padding-left: 24px;
}

.antetitulo {
  font-size: 12.5px;
  letter-spacing: .06em;
  font-weight: 800;
  color: var(--verde);
  text-transform: uppercase;
  line-height: 1.4;
  margin: 0 0 5px;
}

h1 {
  font-size: 26px;
  line-height: 1.2;
  margin: 0;
  color: #183b38;
}

/* Bloques de opción -------------------------------------------------- */

.bloque {
  margin: 24px 0 0;
}

.bloque + .bloque {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--linea);
}

.bloque-cabecera {
  padding: 0 4px;
  margin-bottom: 10px;
}

.bloque-etiqueta {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--verde);
  margin: 0 0 3px;
}

.bloque h2 {
  font-size: 22px;
  line-height: 1.25;
  margin: 0 0 6px;
  color: #183b38;
}

.bloque-desc {
  margin: 0;
  color: var(--texto-suave);
  font-size: 14px;
  max-width: 780px;
}

/* Tarjetas ---------------------------------------------------------- */

.tarjeta {
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: 12px;
  padding: 22px;
  margin: 16px 0;
  box-shadow: 0 2px 9px #123b5d0a;
}

.tarjeta:first-of-type {
  margin-top: 12px;
}

h3 {
  font-size: 18px;
  margin: 0 0 14px;
  color: #183b38;
  display: flex;
  align-items: center;
  gap: 10px;
}

.numero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--menta);
  color: var(--verde-oscuro);
  font-size: 14px;
  font-weight: 800;
}

.ayuda {
  margin: 0 0 14px;
  color: var(--texto-suave);
  font-size: 14px;
}

code {
  font-family: Consolas, "Courier New", monospace;
  background: #eef6f3;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: .92em;
}

.campo label {
  display: block;
  font-weight: 700;
  margin: 0 0 7px;
  color: #273b38;
}

input[type=file],
input[type=search],
input[type=text],
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #b9cbc6;
  border-radius: 7px;
  background: #fff;
  color: #263b38;
  font-family: inherit;
  font-size: inherit;
}

input:disabled,
select:disabled {
  background: #f0f4f3;
  color: #7c8a87;
  cursor: not-allowed;
}

.filtro {
  margin-top: 14px;
}

input[type=file]:focus,
input[type=search]:focus,
input[type=text]:focus,
select:focus {
  outline: 2px solid #79bdb0;
  outline-offset: 1px;
}

.rejilla {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.fila {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.fila input {
  flex: 1 1 auto;
  min-width: 0;
}

.fila button {
  flex: 0 0 auto;
}

.obligatorio {
  font-weight: 600;
  color: #8a5a12;
  font-size: 12px;
}

.portal {
  margin-top: 6px;
}

/* Lista de calles ---------------------------------------------------- */

.vias {
  margin-top: 14px;
}

.lista-vias {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 4px;
}

button.via {
  background: #f4f9f7;
  color: #1d3b37;
  border: 1px solid var(--linea);
  font-weight: 600;
  font-size: 14px;
  padding: 9px 13px;
  text-align: left;
}

button.via:hover {
  background: var(--menta);
  transform: none;
}

button.via.elegida {
  background: var(--verde);
  border-color: var(--verde);
  color: #fff;
}

.sugerencias {
  margin: 10px 0 4px;
  font-size: 14px;
  color: var(--texto-suave);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

button.chip {
  background: var(--menta);
  color: var(--verde-oscuro);
  font-size: 14px;
  padding: 6px 11px;
}

button.chip:hover {
  background: #ccebe1;
  transform: none;
}

/* Botones ----------------------------------------------------------- */

.acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

button {
  border: 0;
  border-radius: 7px;
  background: var(--verde);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 11px 17px;
  cursor: pointer;
  transition: background .15s, transform .15s;
}

button:hover {
  background: var(--verde-oscuro);
  transform: translateY(-1px);
}

button:disabled {
  opacity: .55;
  cursor: wait;
  transform: none;
}

button.secundario {
  background: var(--menta);
  color: var(--verde-oscuro);
}

button.secundario:hover {
  background: #ccebe1;
}

.estado {
  font-size: 13px;
  color: #63726f;
}

/* Datos del proyecto ------------------------------------------------ */

.datos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.datos div {
  background: #f4f9f7;
  padding: 11px;
  border-radius: 7px;
  overflow-wrap: anywhere;
}

.datos b {
  display: block;
  font-size: 12px;
  color: #657570;
  margin-bottom: 5px;
  font-weight: 700;
}

.nota {
  font-size: 13px;
  color: var(--texto-suave);
  margin: 12px 0 0;
}

/* Tabla de resultados ----------------------------------------------- */

.tabla-contenedor {
  overflow-x: auto;
  margin-top: 12px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--linea);
  vertical-align: top;
}

th {
  background: #eef6f3;
  color: #294a45;
  font-weight: 700;
}

.ref {
  font-family: Consolas, "Courier New", monospace;
  white-space: nowrap;
}

/* Avisos ------------------------------------------------------------ */

.aviso {
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff8e5;
  color: #654c11;
  border: 1px solid #eadcae;
  line-height: 1.5;
  margin: 0 0 12px;
}

.aviso a {
  color: #6d4c00;
  font-weight: 700;
}

.mensaje {
  padding: 12px 14px;
  border-radius: 8px;
  margin: 16px 0 0;
  line-height: 1.5;
  border: 1px solid var(--linea);
  background: #fff;
}

.mensaje.error {
  background: #fdecec;
  border-color: #f2c4c4;
  color: #8a2525;
}

.mensaje.exito {
  background: #eaf7ef;
  border-color: #b8dfc5;
  color: #1d5630;
}

.mensaje.info {
  background: #f5fbf8;
  border-color: #cfe5de;
  color: #2a4a45;
}

.oculto {
  display: none !important;
}

/* Pie --------------------------------------------------------------- */

.pie {
  margin: 30px 0 50px;
  text-align: center;
  font-size: 13px;
  color: #6a7a76;
}

.pie a {
  color: var(--verde);
  font-weight: 700;
}

.pie .legal {
  font-size: 12px;
  max-width: 680px;
  margin: 8px auto 0;
}

/* Móvil ------------------------------------------------------------- */

@media (max-width: 700px) {
  .wrap {
    margin-top: 14px;
    padding: 0 12px;
  }

  .cabecera {
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 14px;
    align-items: center;
  }

  .marca {
    order: 1;
  }

  .marca-cgate {
    order: 2;
  }

  .marca img,
  .marca-cgate img {
    height: 48px;
    max-width: 120px;
  }

  .titular {
    order: 3;
    flex: 1 0 100%;
    border-left: 0;
    border-top: 1px solid var(--linea);
    padding: 10px 0 0;
    margin-top: 2px;
  }

  .antetitulo {
    font-size: 10.5px;
    letter-spacing: .08em;
  }

  h1 {
    font-size: 21px;
  }

  input[type=file] {
    font-size: 13px;
    padding: 8px;
  }

  .bloque + .bloque {
    margin-top: 26px;
    padding-top: 20px;
  }

  .bloque h2 {
    font-size: 20px;
  }

  .tarjeta {
    padding: 16px;
  }

  .datos {
    grid-template-columns: 1fr;
  }

  .rejilla {
    grid-template-columns: 1fr;
  }

  .fila {
    flex-direction: column;
  }

  .fila button {
    width: 100%;
  }

  table {
    font-size: 12px;
  }

  th, td {
    padding: 7px 4px;
  }
}
